1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-31 01:29:51 +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:
karim-hza
2017-05-24 18:07:29 +02:00
committed by GitHub
parent b29b7946d6
commit 62f7ae0081

View File

@@ -29,7 +29,10 @@ class Decoder extends \Intervention\Image\AbstractDecoder
break;
case IMAGETYPE_JPEG:
$core = @imagecreatefromjpeg($path);
$core = @imagecreatefromjpeg($path);
if (!$core) {
$core= @imagecreatefromstring(file_get_contents($path));
}
break;
case IMAGETYPE_GIF: