Question about Succesive imagedestroy
Posted: Wed Jan 16, 2008 4:02 am
I have a script that creates a new image by coloring a version of the original obtained by grayscaling it.
An error appears: WARNING: imagedestroy(): 31 is not a valid Image resource color_old.php on line 15. Line 15 is the last line in the code snippet
If I turn off the error message the obtained image is displayed correctly.
An error appears: WARNING: imagedestroy(): 31 is not a valid Image resource color_old.php on line 15. Line 15 is the last line in the code snippet
Code: Select all
/*standard code for creating image using the dimensions of the old one*/
$new=colorOld($old, $color); //colorOld uses the old technique for coloring images
imagejpg($new, 100);
imagedestroy($old);
imagedestroy($new);
If I turn off the error message the obtained image is displayed correctly.