ID: 36418 User updated by: jraben at alstermedia dot de Reported By: jraben at alstermedia dot de -Status: Feedback +Status: Open Bug Type: GD related Operating System: Win XP PHP Version: 5.1.2 New Comment:
Ok! Try this script: http://www.alstermedia.de/phpbug.zip Give 777 to out and script. For for finish and check all pics. Almost on every run there are 3-4 pics with corrupted background. If you do not see a bug try to refresh serveral times. I included a corrupted pic called "1.jpg". Previous Comments: ------------------------------------------------------------------------ [2006-02-16 16:19:39] [EMAIL PROTECTED] Please provide a set of source images and a valid script to reproduce the problems. That means a working script, valid filenames, source images, etc. ------------------------------------------------------------------------ [2006-02-16 16:10:18] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5.1-latest.tar.gz For Windows: http://snaps.php.net/win32/php5.1-win32-latest.zip ------------------------------------------------------------------------ [2006-02-16 15:31:17] jraben at alstermedia dot de Description: ------------ It's a script that joins a background .gif picture with transparent png 24-bit pictures to a thumb jpg. It actually no the complete script. $bfile is always the same. $file and $target may vary. Some files have corrupted backgrounds, if the script is started in multiple instances at the same time. Seems to be a memory allocation bug. Reproduce code: --------------- $img = @imagecreatefromgif("$bfile"); $imgobj = @imagecreatefrompng("$file"); imagealphablending ( $imgobj, true ); $width = imagesx($imgobj); $height = imagesy($imgobj); $imgnew = imagecreatetruecolor($width, $height); imagecopyresampled($imgnew,$img,0,0,$x,$y,$width,$height,$width,$height); imagecopyresampled($imgnew,$imgobj,0,0,0,0,$width,$height,$width,$height); imagejpeg($imgnew, $target, 90); Expected result: ---------------- Not currupted pictures as .jpg with $bfile gif as background and $file .png as foreground. Actual result: -------------- Some files have corrupted backgrounds, if this script is started in multiple instances at the same time. Seems to be a memory allocation bug or something with loading the same picture multiple times at the same time. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36418&edit=1
