[PHP] Image Destroy

2006-08-15 Thread Tom Chubb
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? I've read the even reusing

Re: [PHP] Image Destroy

2006-08-15 Thread chris smith
On 8/15/06, Tom Chubb [EMAIL PROTECTED] 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

Re: [PHP] Image Destroy

2006-08-15 Thread chris smith
On 8/15/06, chris smith [EMAIL PROTECTED] wrote: On 8/15/06, Tom Chubb [EMAIL PROTECTED] 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

Re: [PHP] Image Destroy

2006-08-15 Thread Richard Lynch
On Tue, August 15, 2006 5:45 am, Tom Chubb 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

Re: [PHP] Image Destroy

2006-08-15 Thread Richard Lynch
On Tue, August 15, 2006 6:31 am, chris smith wrote: imagedestroy($target_id); imagedestroy($source_id); just before imagejpeg ($target_id,$targetfile,$jpegqual); return true; } If you destroy it before you write it to disk, you gonna get garbage for your disk JPEG. destroy $target_id

Re: [PHP] Image Destroy

2006-08-15 Thread Chris
Richard Lynch wrote: On Tue, August 15, 2006 6:31 am, chris smith wrote: imagedestroy($target_id); imagedestroy($source_id); just before imagejpeg ($target_id,$targetfile,$jpegqual); return true; } If you destroy it before you write it to disk, you gonna get garbage for your disk JPEG.