mirror of
https://github.com/Intervention/image.git
synced 2025-09-02 10:23:29 +02:00
Use imagecreatefromstring when imagecreatefromjpeg fail
For some image the function 'imagecreatefromstring' does'nt work beacause the image is in violation with the jpeg spec. https://stackoverflow.com/questions/35337709/invalid-sos-parameters-for-sequential-jpeg/43271528#43271528
This commit is contained in:
@@ -29,7 +29,10 @@ class Decoder extends \Intervention\Image\AbstractDecoder
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case IMAGETYPE_JPEG:
|
case IMAGETYPE_JPEG:
|
||||||
$core = @imagecreatefromjpeg($path);
|
$core = @imagecreatefromjpeg($path);
|
||||||
|
if (!$core) {
|
||||||
|
$core= @imagecreatefromstring(file_get_contents($path));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IMAGETYPE_GIF:
|
case IMAGETYPE_GIF:
|
||||||
|
Reference in New Issue
Block a user