luckylooke Posted February 3, 2011 Share Posted February 3, 2011 this is the code <?php $image = imagecreatefromjpeg("9t4i_200xX.jpg"); $new_image = imagecreatetruecolor(120,90); imagecopyresampled($new_image, $image, 0, 0, 0, 0, 120, 90, imagesx($image), imagesy($image)); $image = $new_image; imagejpeg($image,"images/test.jpg"); ?> result is black jpeg image of size 120,90 I dont understand where could be the problem SimpleImage.php script doesnt work either Link to comment https://forums.phpfreaks.com/topic/226597-resizing-jpeg-results-in-black-image/ Share on other sites More sharing options...
luckylooke Posted February 6, 2011 Author Share Posted February 6, 2011 this is the code <?php $image = imagecreatefromjpeg("9t4i_200xX.jpg"); $new_image = imagecreatetruecolor(120,90); imagecopyresampled($new_image, $image, 0, 0, 0, 0, 120, 90, imagesx($image), imagesy($image)); $image = $new_image; imagejpeg($image,"images/test.jpg"); ?> result is black jpeg image of size 120,90 I dont understand where could be the problem SimpleImage.php script doesnt work either Really simple solution: $image = imagecreatefromjpeg("images/9t4i_200xX.jpg"); Question is why it did work before... I havent change my code when it stoped working. Link to comment https://forums.phpfreaks.com/topic/226597-resizing-jpeg-results-in-black-image/#findComment-1170634 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.