Re: Image Destroy

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

 



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 *AFTER* you imagejpeg() it.

Actually, PHP will complain if you try to destroy it first and then
use it later, so you won't get the $targetfile to work at all, really.

But if it did "work" it would just be junk, cuz that image ain't in
RAM no more.

PS
Using "$targetfile" is just silly.

$targetfile is already a string.

Putting quotes around it just makes PHP build a new string with the
same contents again, which is, well, silly.

PHP might even optimize that away, it's so silly, but I'd recommend
just leaving the excessive quotes off in the first place.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
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