Invalid SOS parameters for sequential JPEG

前端 未结 2 873
花落未央
花落未央 2020-12-03 18:01

I\' am getting this error when use imagecreatefromjpeg function.

Warning: imagecreatefromjpeg(): gd-jpeg, libjpeg: recoverable error: Invalid SO         


        
相关标签:
2条回答
  • 2020-12-03 18:36

    I also get the same issue

    we used below code to fix this issue and it works for me.

    $image = @ImageCreateFromJpeg($image_name);
    if (!$image)
    {
    $image= imagecreatefromstring(file_get_contents($image_name));
    }
    
    0 讨论(0)
  • 2020-12-03 18:37

    You can ignore the error with

    ini_set ('gd.jpeg_ignore_warning', 1);
    

    (this is the default since PHP 7.1, but not in older versions)

    See http://php.net/manual/en/image.configuration.php

    0 讨论(0)
提交回复
热议问题