|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-01-28 22:50 UTC] elixer@php.net
[2002-06-09 20:04 UTC] edink@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 22:00:02 2025 UTC |
When using jpg picture when PHP says it is corrupt (when it is not) then Server crashes with function imagecreatefromjpeg. See source below ! $srcImg = imagecreatefromjpeg($fileName); $scale = 4; // create a (blank) smaller image object $srcSize = getimagesize($fileName); $dstImg = imagecreate($srcSize[0]/$scale, $srcSize[1]/$scale); // copy and resize from the source image object to the smaller blank one imagecopyresized($dstImg, $srcImg, 0, 0, 0, 0, $srcSize[0]/$scale, $srcSize[1]/$scale, $srcSize[0], $srcSize[1]); // send the smaller image object to the browser $plaatje = imagejpeg($dstImg); // clean up imagedestroy($scrImg); imagedestroy($dstImg);