Re: Image Destroy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 8/15/06, Tom Chubb <tomchubb@xxxxxxxxx> wrote:
I know this will be really simple, but I'm struggling to get my head round
the use of imagedestroy()
I have some code which uploads an image, resizes to create a smaller image
and thumbnail then deletes the source image.
My question is which images need to be destroyed?

Straight from the manual:
imagedestroy() frees any memory associated with image image. image is
the image identifier returned by one of the image create functions,
such as imagecreatetruecolor()

So any time you call imagecreate* functions you need to also do an imagedestroy.

In your case you need to add

imagedestroy($target_id);
imagedestroy($source_id);


just before

imagejpeg ($target_id,"$targetfile",$jpegqual);
return true;
}


--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux