Search the Community
Showing results for tags 'create image'.
-
Hello i am just wondering about this code - its strange... when i just work with one section it works... but thing is i want to create two images from the one image in the /temp/ directory. This will then have two sent to /small/ and /large/ but it just comes up blank with no error... yet it only happens with larger image file sizes and .JPG extensions instead of .jpg.... The strange thing is... if i just work with one section of the code... it works! ...whatever the image. Hope you can help. Thanks Lewis $image_name = 'image'; $product_src1 = 'plus_cms/image_uploads/product_images/temp/'.$image_name.'.jpg'; $product_src2 = 'plus_cms/image_uploads/product_images/temp/'.$image_name.'.jpg'; $product_src3 = 'plus_cms/image_uploads/product_images/small/'.$image_name.'.jpg'; $product_src4 = 'plus_cms/image_uploads/product_images/large/'.$image_name.'.jpg'; $targ_w1 = $get_width; $targ_h1 = $get_height; $im1 = imagecreatetruecolor($targ_w1, $targ_h1) or die('Cannot Initialize new GD image stream'); // Background to Image $img_r1 = imagecreatefromjpeg($product_src1); //Creating Image $image1 = imagecopyresampled($im1,$img_r1,0,0,$_POST['x'],$_POST['y'],$targ_w1,$targ_h1,$_POST['w'],$_POST['h']); imagejpeg($im1, $product_src3); $targ_w2 = $get_width * 2; $targ_h2 = $get_height * 2; $im2 = imagecreatetruecolor($targ_w2, $targ_h2) or die('Cannot Initialize new GD image stream'); $img_r2 = imagecreatefromjpeg($product_src2); $image2 = imagecopyresampled($im2,$img_r2,0,0,$_POST['x'],$_POST['y'],$targ_w2,$targ_h2,$_POST['w'],$_POST['h']); imagejpeg($im2, $product_src4);