#36726 [Bgs]: imagecreatefromjpeg() crahes PHP
ID: 36726 User updated by: christoph at ziegenberg dot com Reported By: christoph at ziegenberg dot com Status: Bogus Bug Type: GD related Operating System: Suse Linux 9.3 PHP Version: 5.1.2 Assigned To: pajoye New Comment: Thanks a lot, I understand what you mean. I only want to add (for other users) that all images are 24 Bit = 3 Byte per pixel, so the calculation isn't as simple as that (to multiply the dimension and channel values from getimagesize()). Previous Comments: [2006-03-20 22:34:03] [EMAIL PROTECTED] Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php the file size of a JPEG data has nothing to do with the size of the *uncompressed* pixel data in memory. For example, your images is 1600x1200, true colors (4bytes per pixel): == 768 bytes add to that the whole memory that your script or php may need and you are out of the 8M. Now please, keep this bug as closed as there is obviously no bug. If you need support feel free to use our numerous support possibilies. [2006-03-20 22:28:46] christoph at ziegenberg dot com Bye the way: I added the additional information to the phpinfo() output with the error_reporting, memory_limit,... settings. [2006-03-20 22:22:41] christoph at ziegenberg dot com Thanks, got the reason... error_reporting was active, but display_errors wasn't and the error has not been logged. I changed it and got the following error for image 18925.jpg: Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 1600 bytes) I didn't expect that PHP needs so much memory for an image less than 200 KB - and I do NOT think that this is a normal behaviour, because there are much larger images (e.g. the new test image "2.jpg" with about 1.5 MB) which work fine with the recommended value 8M... Changing it to 16M works for all images. I think that this error should not occur for the mentioned example image and that there is an error with the image processing wasting all the memory. So I changed this bug again to open... hope you agree. [2006-03-20 21:05:35] [EMAIL PROTECTED] Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php 21839.jpg: Warning: imagecreatefromjpeg(): gd-jpeg, libjpeg: recoverable error: Corrupt JPEG data: 121 extraneous bytes before marker 0xd9 7737.jpg: Warning: imagecreatefromjpeg(): gd-jpeg, libjpeg: recoverable error: Corrupt JPEG data: 135 extraneous bytes before marker 0xd9 These two jpeg images are not valid. From php 5.1.3 (try using snapshot.php.net 5.1.x), you can ignore the warnings or minor errors using this command: ini_set("gd.jpeg_ignore_warning", true); I set to "expected behavior". By the way, you should use error_reporting(E_ALL); when you develop. -------- [2006-03-20 20:16:28] christoph at ziegenberg dot com Download it here: http://www.ziegenberg.com/jpegbug/images.zip Maybe the setup is the problem, but 99% of the uploaded images work fine. Nevertheless you should get an error you can work with... The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/36726 -- Edit this bug report at http://bugs.php.net/?id=36726&edit=1
#36726 [Opn]: imagecreatefromjpeg() crahes PHP
ID: 36726 User updated by: christoph at ziegenberg dot com Reported By: christoph at ziegenberg dot com Status: Open Bug Type: GD related Operating System: Suse Linux 9.3 PHP Version: 5.1.2 Assigned To: pajoye New Comment: Bye the way: I added the additional information to the phpinfo() output with the error_reporting, memory_limit,... settings. Previous Comments: [2006-03-20 22:22:41] christoph at ziegenberg dot com Thanks, got the reason... error_reporting was active, but display_errors wasn't and the error has not been logged. I changed it and got the following error for image 18925.jpg: Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 1600 bytes) I didn't expect that PHP needs so much memory for an image less than 200 KB - and I do NOT think that this is a normal behaviour, because there are much larger images (e.g. the new test image "2.jpg" with about 1.5 MB) which work fine with the recommended value 8M... Changing it to 16M works for all images. I think that this error should not occur for the mentioned example image and that there is an error with the image processing wasting all the memory. So I changed this bug again to open... hope you agree. [2006-03-20 21:05:35] [EMAIL PROTECTED] Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php 21839.jpg: Warning: imagecreatefromjpeg(): gd-jpeg, libjpeg: recoverable error: Corrupt JPEG data: 121 extraneous bytes before marker 0xd9 7737.jpg: Warning: imagecreatefromjpeg(): gd-jpeg, libjpeg: recoverable error: Corrupt JPEG data: 135 extraneous bytes before marker 0xd9 These two jpeg images are not valid. From php 5.1.3 (try using snapshot.php.net 5.1.x), you can ignore the warnings or minor errors using this command: ini_set("gd.jpeg_ignore_warning", true); I set to "expected behavior". By the way, you should use error_reporting(E_ALL); when you develop. -------- [2006-03-20 20:16:28] christoph at ziegenberg dot com Download it here: http://www.ziegenberg.com/jpegbug/images.zip Maybe the setup is the problem, but 99% of the uploaded images work fine. Nevertheless you should get an error you can work with... [2006-03-20 19:42:57] [EMAIL PROTECTED] Sorry, can you provide me *one* archive with all the images inside? FYI, I tried "11848.jpg" and it works well. I feel like your system is broken or you are doing something wrong in your setup. ------------ [2006-03-20 19:33:55] christoph at ziegenberg dot com I added the following images: 21839.jpg, 21494.jpg, 7737.jpg, 22086.jpg, 11848.jpg You can see the GD information on the main page (gd_info() output), but now you will also see the output from the phpinfo() (filtered to not publish more information than needed). "cannot be opened by imagecreatefromjpeg" means that the function imagecreatefromjpeg() will return an empty string and create an error for some of the new image - try it and you'll see what I mean. This is what I expect for the first uploaded images if there is something wrong with the format (although I don't know what this is for the example images)... The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/36726 -- Edit this bug report at http://bugs.php.net/?id=36726&edit=1
#36726 [Bgs->Opn]: imagecreatefromjpeg() crahes PHP
ID: 36726 User updated by: christoph at ziegenberg dot com Reported By: christoph at ziegenberg dot com -Status: Bogus +Status: Open Bug Type: GD related Operating System: Suse Linux 9.3 PHP Version: 5.1.2 Assigned To: pajoye New Comment: Thanks, got the reason... error_reporting was active, but display_errors wasn't and the error has not been logged. I changed it and got the following error for image 18925.jpg: Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 1600 bytes) I didn't expect that PHP needs so much memory for an image less than 200 KB - and I do NOT think that this is a normal behaviour, because there are much larger images (e.g. the new test image "2.jpg" with about 1.5 MB) which work fine with the recommended value 8M... Changing it to 16M works for all images. I think that this error should not occur for the mentioned example image and that there is an error with the image processing wasting all the memory. So I changed this bug again to open... hope you agree. Previous Comments: [2006-03-20 21:05:35] [EMAIL PROTECTED] Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php 21839.jpg: Warning: imagecreatefromjpeg(): gd-jpeg, libjpeg: recoverable error: Corrupt JPEG data: 121 extraneous bytes before marker 0xd9 7737.jpg: Warning: imagecreatefromjpeg(): gd-jpeg, libjpeg: recoverable error: Corrupt JPEG data: 135 extraneous bytes before marker 0xd9 These two jpeg images are not valid. From php 5.1.3 (try using snapshot.php.net 5.1.x), you can ignore the warnings or minor errors using this command: ini_set("gd.jpeg_ignore_warning", true); I set to "expected behavior". By the way, you should use error_reporting(E_ALL); when you develop. -------- [2006-03-20 20:16:28] christoph at ziegenberg dot com Download it here: http://www.ziegenberg.com/jpegbug/images.zip Maybe the setup is the problem, but 99% of the uploaded images work fine. Nevertheless you should get an error you can work with... [2006-03-20 19:42:57] [EMAIL PROTECTED] Sorry, can you provide me *one* archive with all the images inside? FYI, I tried "11848.jpg" and it works well. I feel like your system is broken or you are doing something wrong in your setup. ------------ [2006-03-20 19:33:55] christoph at ziegenberg dot com I added the following images: 21839.jpg, 21494.jpg, 7737.jpg, 22086.jpg, 11848.jpg You can see the GD information on the main page (gd_info() output), but now you will also see the output from the phpinfo() (filtered to not publish more information than needed). "cannot be opened by imagecreatefromjpeg" means that the function imagecreatefromjpeg() will return an empty string and create an error for some of the new image - try it and you'll see what I mean. This is what I expect for the first uploaded images if there is something wrong with the format (although I don't know what this is for the example images)... [2006-03-20 18:58:12] [EMAIL PROTECTED] Sorry I do not trace your changes :) which files did you add? Cannot be opened by imagecreatefromjpeg? What does that mean? It crashes or you have an error message? The phpinfo you provide is useless as it does not show the GD informations... The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/36726 -- Edit this bug report at http://bugs.php.net/?id=36726&edit=1
#36726 [Fbk->Opn]: imagecreatefromjpeg() crahes PHP
ID: 36726 User updated by: christoph at ziegenberg dot com Reported By: christoph at ziegenberg dot com -Status: Feedback +Status: Open Bug Type: GD related Operating System: Suse Linux 9.3 PHP Version: 5.1.2 Assigned To: pajoye New Comment: Download it here: http://www.ziegenberg.com/jpegbug/images.zip Maybe the setup is the problem, but 99% of the uploaded images work fine. Nevertheless you should get an error you can work with... Previous Comments: [2006-03-20 19:42:57] [EMAIL PROTECTED] Sorry, can you provide me *one* archive with all the images inside? FYI, I tried "11848.jpg" and it works well. I feel like your system is broken or you are doing something wrong in your setup. [2006-03-20 19:33:55] christoph at ziegenberg dot com I added the following images: 21839.jpg, 21494.jpg, 7737.jpg, 22086.jpg, 11848.jpg You can see the GD information on the main page (gd_info() output), but now you will also see the output from the phpinfo() (filtered to not publish more information than needed). "cannot be opened by imagecreatefromjpeg" means that the function imagecreatefromjpeg() will return an empty string and create an error for some of the new image - try it and you'll see what I mean. This is what I expect for the first uploaded images if there is something wrong with the format (although I don't know what this is for the example images)... [2006-03-20 18:58:12] [EMAIL PROTECTED] Sorry I do not trace your changes :) which files did you add? Cannot be opened by imagecreatefromjpeg? What does that mean? It crashes or you have an error message? The phpinfo you provide is useless as it does not show the GD informations... ---- [2006-03-20 18:45:55] christoph at ziegenberg dot com It is the bundled GD. I added two additional files for you to compare - one working fine and one producing the expected error, because it could not be opened by imagecreatefromjpeg(). And I added a link to allow you a look on the basic phpinfo() output. I will provide you with further information, if needed. As I already mentioned it seems to work on other systems. And as also mentioned another user had the same problem - so there seems to be something wrong, doesn't it? [2006-03-18 23:24:09] [EMAIL PROTECTED] Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. All images work well for me. You can try yourself with this script, put all your images in a 36726 folder and run this script: $basedir = "./36726/"; $images = array('14844.jpg', '18925.jpg', '21987.jpg'); foreach ($images as $a) { $im = imagecreatefromjpeg($basedir . $a); imagejpeg($im, $basedir . "$a.2.jpeg"); echo "$a done\n"; } Be sure to use the bundled GD ("configure --with-gd"). The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/36726 -- Edit this bug report at http://bugs.php.net/?id=36726&edit=1
#36726 [Fbk->Opn]: imagecreatefromjpeg() crahes PHP
ID: 36726 User updated by: christoph at ziegenberg dot com Reported By: christoph at ziegenberg dot com -Status: Feedback +Status: Open Bug Type: GD related Operating System: Suse Linux 9.3 PHP Version: 5.1.2 Assigned To: pajoye New Comment: I added the following images: 21839.jpg, 21494.jpg, 7737.jpg, 22086.jpg, 11848.jpg You can see the GD information on the main page (gd_info() output), but now you will also see the output from the phpinfo() (filtered to not publish more information than needed). "cannot be opened by imagecreatefromjpeg" means that the function imagecreatefromjpeg() will return an empty string and create an error for some of the new image - try it and you'll see what I mean. This is what I expect for the first uploaded images if there is something wrong with the format (although I don't know what this is for the example images)... Previous Comments: [2006-03-20 18:58:12] [EMAIL PROTECTED] Sorry I do not trace your changes :) which files did you add? Cannot be opened by imagecreatefromjpeg? What does that mean? It crashes or you have an error message? The phpinfo you provide is useless as it does not show the GD informations... [2006-03-20 18:45:55] christoph at ziegenberg dot com It is the bundled GD. I added two additional files for you to compare - one working fine and one producing the expected error, because it could not be opened by imagecreatefromjpeg(). And I added a link to allow you a look on the basic phpinfo() output. I will provide you with further information, if needed. As I already mentioned it seems to work on other systems. And as also mentioned another user had the same problem - so there seems to be something wrong, doesn't it? [2006-03-18 23:24:09] [EMAIL PROTECTED] Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. All images work well for me. You can try yourself with this script, put all your images in a 36726 folder and run this script: $basedir = "./36726/"; $images = array('14844.jpg', '18925.jpg', '21987.jpg'); foreach ($images as $a) { $im = imagecreatefromjpeg($basedir . $a); imagejpeg($im, $basedir . "$a.2.jpeg"); echo "$a done\n"; } Be sure to use the bundled GD ("configure --with-gd"). ---------------- [2006-03-18 18:40:55] christoph at ziegenberg dot com I uploaded the images and a testscript. Look here: http://www.ziegenberg.com/jpegbug/ [2006-03-13 22:59:31] [EMAIL PROTECTED] Not enough information was provided for us to be able to handle this bug. Please re-read the instructions at http://bugs.php.net/how-to-report.php If you can provide more information, feel free to add it to this bug and change the status back to "Open". Thank you for your interest in PHP. Please give us an image to reproduce your problem. The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/36726 -- Edit this bug report at http://bugs.php.net/?id=36726&edit=1
#36726 [Bgs->Opn]: imagecreatefromjpeg() crahes PHP
ID: 36726 User updated by: christoph at ziegenberg dot com Reported By: christoph at ziegenberg dot com -Status: Bogus +Status: Open Bug Type: GD related Operating System: Suse Linux 9.3 PHP Version: 5.1.2 Assigned To: pajoye New Comment: It is the bundled GD. I added two additional files for you to compare - one working fine and one producing the expected error, because it could not be opened by imagecreatefromjpeg(). And I added a link to allow you a look on the basic phpinfo() output. I will provide you with further information, if needed. As I already mentioned it seems to work on other systems. And as also mentioned another user had the same problem - so there seems to be something wrong, doesn't it? Previous Comments: [2006-03-18 23:24:09] [EMAIL PROTECTED] Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. All images work well for me. You can try yourself with this script, put all your images in a 36726 folder and run this script: $basedir = "./36726/"; $images = array('14844.jpg', '18925.jpg', '21987.jpg'); foreach ($images as $a) { $im = imagecreatefromjpeg($basedir . $a); imagejpeg($im, $basedir . "$a.2.jpeg"); echo "$a done\n"; } Be sure to use the bundled GD ("configure --with-gd"). ---------------- [2006-03-18 18:40:55] christoph at ziegenberg dot com I uploaded the images and a testscript. Look here: http://www.ziegenberg.com/jpegbug/ [2006-03-13 22:59:31] [EMAIL PROTECTED] Not enough information was provided for us to be able to handle this bug. Please re-read the instructions at http://bugs.php.net/how-to-report.php If you can provide more information, feel free to add it to this bug and change the status back to "Open". Thank you for your interest in PHP. Please give us an image to reproduce your problem. -------------------- [2006-03-13 22:37:23] christoph at ziegenberg dot com Description: Using imagecreatefromjpeg() lets PHP crash without an error message. also using @imagecreatefromjpeg() doesn't help - it's not possible to check the returning value. I the user comments a user already described problems with jpegs created by "Canon PowerShot S70", my image (uploaded by a user) was created by a "Canon PowerShot A400". So this seems to be the problem. It worked on my Windows XP without any problem, but on Suse it crashed... Reproduce code: --- I'll ask the user to upload the picture here. Then simply call imagecreatefromjpeg() with this image. Expected result: No crash, but an error message and an empty return value. Actual result: -- Crash -- Edit this bug report at http://bugs.php.net/?id=36726&edit=1
#36726 [Fbk->Opn]: imagecreatefromjpeg() crahes PHP
ID: 36726 User updated by: christoph at ziegenberg dot com Reported By: christoph at ziegenberg dot com -Status: Feedback +Status: Open Bug Type: GD related Operating System: Suse Linux 9.3 PHP Version: 5.1.2 Assigned To: pajoye New Comment: I uploaded the images and a testscript. Look here: http://www.ziegenberg.com/jpegbug/ Previous Comments: [2006-03-13 22:59:31] [EMAIL PROTECTED] Not enough information was provided for us to be able to handle this bug. Please re-read the instructions at http://bugs.php.net/how-to-report.php If you can provide more information, feel free to add it to this bug and change the status back to "Open". Thank you for your interest in PHP. Please give us an image to reproduce your problem. [2006-03-13 22:37:23] christoph at ziegenberg dot com Description: Using imagecreatefromjpeg() lets PHP crash without an error message. also using @imagecreatefromjpeg() doesn't help - it's not possible to check the returning value. I the user comments a user already described problems with jpegs created by "Canon PowerShot S70", my image (uploaded by a user) was created by a "Canon PowerShot A400". So this seems to be the problem. It worked on my Windows XP without any problem, but on Suse it crashed... Reproduce code: --- I'll ask the user to upload the picture here. Then simply call imagecreatefromjpeg() with this image. Expected result: No crash, but an error message and an empty return value. Actual result: -- Crash -- Edit this bug report at http://bugs.php.net/?id=36726&edit=1
#36726 [NEW]: imagecreatefromjpeg() crahes PHP
From: christoph at ziegenberg dot com Operating system: Suse Linux 9.3 PHP version: 5.1.2 PHP Bug Type: GD related Bug description: imagecreatefromjpeg() crahes PHP Description: Using imagecreatefromjpeg() lets PHP crash without an error message. also using @imagecreatefromjpeg() doesn't help - it's not possible to check the returning value. I the user comments a user already described problems with jpegs created by "Canon PowerShot S70", my image (uploaded by a user) was created by a "Canon PowerShot A400". So this seems to be the problem. It worked on my Windows XP without any problem, but on Suse it crashed... Reproduce code: --- I'll ask the user to upload the picture here. Then simply call imagecreatefromjpeg() with this image. Expected result: No crash, but an error message and an empty return value. Actual result: -- Crash -- Edit bug report at http://bugs.php.net/?id=36726&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=36726&r=trysnapshot44 Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=36726&r=trysnapshot51 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=36726&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=36726&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=36726&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=36726&r=needtrace Need Reproduce Script:http://bugs.php.net/fix.php?id=36726&r=needscript Try newer version:http://bugs.php.net/fix.php?id=36726&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=36726&r=support Expected behavior:http://bugs.php.net/fix.php?id=36726&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=36726&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=36726&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=36726&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36726&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=36726&r=dst IIS Stability:http://bugs.php.net/fix.php?id=36726&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=36726&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=36726&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=36726&r=nozend MySQL Configuration Error:http://bugs.php.net/fix.php?id=36726&r=mysqlcfg