PHP JPEG Functions Not Working

余生长醉 提交于 2019-12-02 01:59:31

Your error log clearly shows that your PHP is compiled against/requires libjpeg version 62, while the library on your server is version 80.

Either install the correct version of libjpeg, or recompile gd/php.

It appears that the file test.jpg doesn't exist, or isn't the correct filetype headers (eg, if someone renames a test.png as test.jpg it will still have the .png headers). Try creating a new test.jpg file using an image editing program and see if it works.

An answer that worked for me was to work around the image altogether and trearit as a string.

Ill try to do it the standard way, but if it doesnt work, try it as a string

      $src = imagecreatefromjpeg($file);
      if (!$src) {
      $src = imagecreatefromstring(file_get_contents($file));
      }

There are apparently some issue wilth older versions or combos of GD an PHP.

In my case I had an image using a newer version/compression of jpeg 7 I think.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!