简体   繁体   中英

JPG Images not displaying in IE and Firefox

I'm having a weird problem and it's driving me crazy. The problem is that every jpg image is not displayed in IE and Firefox browsers, while displaying properly in Chrome and Opera. What could be the cause of this problem? In IE when trying to open a jpg image into a new tab, shows me a bunch of strange characters instead of showing me the image, in Mozilla it pops in the "Save image" insted of open it.

Thank you in advance!

The server is sending images with text/plain MIME type. The "strange characters" are the text form of the image bytes.

在此处输入图片说明

On a nginx server, add the following to /etc/nginx/mime.types to make sure it serves jpg files as an image.

types {
    image/jpeg        jpg;
}

For an Apache server, create an .htaccess file in the same directory as the images. Add the line:

AddType image/jpeg .jpg

You got an JPG which uses CMYK instead of RGB encoding, and Firefox/IE choke on such files. You just need to convert the JPGs to RGB colorspace, or in Photoshop you can save image like " Save for web"

I found the problematic plugin, it's called "EWWW Image Optimizer" which converts the JPG images to WebP format. They have an alternative rewriting in case the images are served from a CDN which seems to not be working yet.

Thank you for trying to help me!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM