Automattic / regenerate-thumbnails

WordPress plugin for regenerating thumbnails of uploaded images. Over 1 million active users and counting.
https://alex.blog/wordpress-plugins/regenerate-thumbnails/
GNU General Public License v2.0
136 stars 56 forks source link

ERROR: The current image editor cannot process this file type #83

Closed donaldallen closed 5 years ago

donaldallen commented 5 years ago

ERROR: The current image editor cannot process this file type.

Image is a JPG.

From WP Health Check:

Active editor | WP_Image_Editor_Imagick
Imagick Module Version | 1687
ImageMagick Version | ImageMagick 6.9.7-4 Q16 x86_64 20170114 http://www.imagemagick.org
Imagick Resource Limits | area: 122 MBdisk: 1073741824file: 768map: 512 MBmemory: 256 MBthread: 1
GD Version | 2.2.5
Ghostscript Version | 9.26

I've also tried using wp-cli:

test@test:/var/www/test.com$ wp media regenerate 28402
Found 1 image to regenerate.
1/1 Skipped thumbnail regeneration for "3" (ID 28402).
Success: Regenerated 0 of 1 images (1 skipped).

Here are some server details from WP Health Check:

Server architecture | Linux 4.15.0-1035-azure x86_64
Web Server Software | nginx/1.14.0
PHP Version | 7.2.10-0ubuntu0.18.04.1 (Supports 64bit values)
PHP SAPI | fpm-fcgi
PHP max input variables | 1000
PHP time limit | 60
PHP memory limit | 256M
Max input time | 60
Upload max filesize | 2M
PHP post max size | 8M
cURL Version | 7.58.0 OpenSSL/1.1.0g
SUHOSIN installed | No
Is the Imagick library available | Yes
Viper007Bond commented 5 years ago

Are you sure the file is actually a JPEG image? Perhaps it has the wrong file extension. The fact that WP-CLI rejects it too is informative as it has its own set of regeneration code.

donaldallen commented 5 years ago

The mimetype that WordPress media library shows for all my client's JPG images is:

image/x-citrix-jpeg

Would that have anything to do with it?

Viper007Bond commented 5 years ago

I think so. I don't recognize that MIME type. My plugin (and probably WP-CLI) tries to regenerate image/* rather than a whitelist as it doesn't know what the image editor supports until it has the image editor actually try to open the file.

donaldallen commented 5 years ago

Do you know what I could do to work around this?

Viper007Bond commented 5 years ago

Seems like it's the result of using Internet Explorer in Citrix. Some reading here: https://stackoverflow.com/a/2600324

The file is apparently identical to a regular JPEG, so you might be able to fix it by downloading the image, opening it in your favorite image editor, and then saving it again. That might reset the MIME type but I'm not sure. If it does, then you can upload it properly.

donaldallen commented 5 years ago

FYI, if anyone else comes across this problem, it seems that my client was uploading images through IE in Citrix. Very strange. So all I had to do was a find/replace in the database for image/x-citrix-jpeg and replace with image/jpeg and that did the trick!

techbizblog commented 4 years ago

The current image editor cannot process this file type. i am using Newspaper theme in Wordpress. I have uploaded all webP images but not showing in thumbnail in website. i have also added feature image. When I open a particular post it is showing. but not showing in website category .

Erudition commented 2 years ago

For me, it was using the custom WP file types plugin, and disabling wordpress internal checks (so that I can upload whatever I want, on a site I'm sole developer). Going back to Wordpress rules made the thumbnails work, which was necessary even after I fixed 65 "citrix" images using @donaldallen 's trick.