Bug #75888 [Opn->Csd]: imagecreatefromstring function throws uncatchable error.

From: Date: Tue, 30 Jan 2018 13:06:39 +0000
Subject: Bug #75888 [Opn->Csd]: imagecreatefromstring function throws uncatchable error.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-213753@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75888&edit=1

 ID:                 75888
 Updated by:         cmb@php.net
 Reported by:        grothentor at gmail dot com
 Summary:            imagecreatefromstring function throws uncatchable
                     error.
-Status:             Open
+Status:             Closed
 Type:               Bug
-Package:            FPM related
+Package:            GD related
 Operating System:   Linux 4.4.0-1032-aws x86_64
 PHP Version:        7.1.13
-Assigned To:        
+Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

> […] I found that on local machine GD library Version 2.2.5 and
> on server it has 2.2.3 version.  […]

And that's the problem, since this issue has only be resolved in
GD 2.2.5, see <https://github.com/libgd/libgd/issues/338>. 
Either
update to GD 2.2.5, or use the bundled libgd which didn't have
this issue.


Previous Comments:
------------------------------------------------------------------------
[2018-01-30 10:48:34] grothentor at gmail dot com

Description:
------------
documentation says that imagecreatefromstring function trows only E_WARNING lavel errors but if
image is broken it throws fatal error.

on local machine with apache2 + php (with same php version and Linux 4.4.0-53-generic) it works
fine. (expected result copied from local machine).

In differences of phpinfo() I found that on local machine GD library Version 2.2.5 and on server it
has 2.2.3 version. but header versions are same and running apt-get install php7.1-gb says that
"already up to date"

p.s. i got that errors from ~7.1.9, mb earlier after update php on local machine it were fixed, but
on server it doesn't help. 

Test script:
---------------
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

$image = file_get_contents('http://novostoy.com.ua/files/obekti/974144_3.jpg');
$image = imagecreatefromstring($image);

echo 'image processed';

Expected result:
----------------
Warning: imagecreatefromstring(): gd-jpeg: JPEG library reports unrecoverable error: Unsupported
marker type 0x8e in index.php on line 7

Warning: imagecreatefromstring(): Passed data is not in 'JPEG' format in index.php on line
7

Warning: imagecreatefromstring(): Couldn't create GD Image Stream out of Data in index.php on
line 7
image processed

Actual result:
--------------
Fatal error: imagecreatefromstring(): gd-jpeg: JPEG library reports unrecoverable error: Unsupported
marker type 0x8e in index.php on line 7


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=75888&edit=1


Thread (4 messages)

« previous php.bugs (#213753) next »