Bug #73116 [Fbk->Asn]: imagecreatefromjpeg fatal error on empty file
| From: | chupaka at gmail dot com | Date: | Sat, 24 Sep 2016 15:48:16 +0000 |
| Subject: | Bug #73116 [Fbk->Asn]: imagecreatefromjpeg fatal error on empty file | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-204244@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=73116&edit=1
ID: 73116
User updated by: chupaka at gmail dot com
Reported by: chupaka at gmail dot com
Summary: imagecreatefromjpeg fatal error on empty file
-Status: Feedback
+Status: Assigned
Type: Bug
Package: GD related
Operating System: Fedora 24
PHP Version: 5.6.26
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
[root@new-info ~]# dnf list installed php gd libjpeg-turbo
Last metadata expiration check: 1:16:50 ago on Sat Sep 24 17:28:15 2016.
Installed Packages
gd.x86_64 2.2.3-2.fc24 @updates
libjpeg-turbo.x86_64 1.5.0-2.fc24 @updates
php.x86_64 5.6.26-1.fc24 @updates-testing
[root@new-info ~]#
Previous Comments:
------------------------------------------------------------------------
[2016-09-24 14:33:39] cmb@php.net
I can't reproduce the fatal PHP error.
Which libgd and libjpeg version do you use? And is this really
about PHP 5.6.26?
------------------------------------------------------------------------
[2016-09-19 22:00:00] chupaka at gmail dot com
Description:
------------
When using imagecreatefromjpeg on empty file, PHP generates Fatal error instead of warning, so
it's impossible to handle the error.
Test script:
---------------
<?php
touch('emptyfile');
imagecreatefromjpeg('notexist');
imagecreatefromjpeg('emptyfile');
echo "Continue with error handling";
Expected result:
----------------
PHP Warning: imagecreatefromjpeg(notexist): failed to open stream: No such file or directory in
/var/www/test.php on line 5
PHP Warning: imagecreatefromjpeg(emptyfile): gd-jpeg: JPEG library reports unrecoverable error:
Empty input file in /var/www/test.php on line 6
Continue with error handling
Actual result:
--------------
PHP Warning: imagecreatefromjpeg(notexist): failed to open stream: No such file or directory in
/var/www/test.php on line 5
PHP Fatal error: imagecreatefromjpeg(): gd-jpeg: JPEG library reports unrecoverable error: Empty
input file in /var/www/test.php on line 6
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=73116&edit=1