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

From: Date: Tue, 30 Jan 2018 10:48:41 +0000
Subject: Bug #75888 [NEW]: imagecreatefromstring function throws uncatchable error.
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-213751@lists.php.net to get a copy of this message
From: grothentor at gmail dot com Operating system: Linux 4.4.0-1032-aws x86_64 PHP version: 7.1.13 Package: FPM related Bug Type: Bug Bug description:imagecreatefromstring function throws uncatchable error. 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 bug report at https://bugs.php.net/bug.php?id=75888&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75888&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75888&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75888&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=75888&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=75888&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=75888&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=75888&r=needscript Try newer version: https://bugs.php.net/fix.php?id=75888&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=75888&r=support Expected behavior: https://bugs.php.net/fix.php?id=75888&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=75888&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=75888&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=75888&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75888&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=75888&r=dst IIS Stability: https://bugs.php.net/fix.php?id=75888&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=75888&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=75888&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=75888&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=75888&r=mysqlcfg

« previous php.bugs (#213751) next »