note 17974 deleted from function.imagecreatefromjpeg by cmb
| From: | cmb@php.net | Date: | Sun, 11 Dec 2016 11:06:43 +0000 |
| Subject: | note 17974 deleted from function.imagecreatefromjpeg by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-208488@lists.php.net to get a copy of this message | ||
Note Submitter: mihkel at raba dot ee
----
[Ed Note: You must have netpbm installed for this to work --alindeman @ php.net]
Just wanted to let you know that
imagecreatefromjpeg crashes php
(command line at least) sometimes with segmentation fault when jpeg is corrupted.
To get rid of the nasty segmentation fault i used
system ("jpegtopnm f.jpg > f.pnm", $r);
if ($r != 0) {printf ("invalid jpeg\n"); return; }
system ("pnmtopng f.pnm > f.png");
$im =imagecreatefrompng ("f.png");