script22 Posted November 13, 2012 Share Posted November 13, 2012 as vrea sa tai din mijloc si sa creez o noua imagine jumatate din cea originala aici am un cod la care am lucrat ceva ore bune da nu merge imi face o imagine neagra si nu stiu dc $fileext = strtolower(substr($file,strrpos($file,".")+1));if($fileext=="jpg" || $fileext=="jpeg" ){$new_image = imagecreatefromjpeg($bulk);$image_save_func = 'ImageJPEG';}else if($fileext=="png"){$new_image = imagecreatefrompng($bulk);$image_save_func = 'ImagePNG';}else {$new_image = imagecreatefromgif($bulk);$image_save_func = 'ImageGIF';}$width = imagesx($new_image);$height = imagesy($new_image);$new_width = $width /2;$new_height = $height /2;$dst_x = 0;$dst_y = 0;$src_x = $new_height/2;$src_y = $new_width /2;$image_c = ImageCreateTrueColor($new_width, $new_height);imagecopyresampled ($image_c, $new_image, $dst_x, $dst_y, $src_x, $src_y, $new_width, $new_height, $height, $width);$image_save_func($image_c, $new_location.$category.$filename_clean);unlink($bulk); Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now