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

From: Date: Tue, 30 Jan 2018 17:03:24 +0000
Subject: Bug #75888 [Csd]: imagecreatefromstring function throws uncatchable error.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-213756@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:             Closed
 Type:               Bug
 Package:            GD related
 Operating System:   Linux 4.4.0-1032-aws x86_64
 PHP Version:        7.1.13
 Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

> can you please give me any suggestions why i can't update that
> library?

You may need to get libgd2
2.2.5-4+ubuntu16.04.1+deb.sury.org+1[1].

Anyhow, 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.

[1] <https://launchpad.net/~ondrej/+archive/ubuntu/php/+index?batch=75>


Previous Comments:
------------------------------------------------------------------------
[2018-01-30 16:40:48] grothentor at gmail dot com

can you please give me any suggestions why i can't update that library?

all my tries says "php7.1-gd is already the newest version
(7.1.13-1+ubuntu16.04.1+deb.sury.org+1).", but i still have 2.2.3 version of library and 2.2.5
of headers.

i restart php-fpm and even nginx and machine.
also i try reinstall php7.1-gb, it install the same version.

------------------------------------------------------------------------
[2018-01-30 13:06:36] cmb@php.net

> […] 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.

------------------------------------------------------------------------
[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 (#213756) next »