How to tell if images are saved as the wrong file type | Acquia Product Documentation
Cloud Platform
How to tell if images are saved as the wrong file type
How to tell if images are saved as the wrong file type
Date Published: February 23, 2022
In some cases, Internet Explorer browser will fail to display images that claim to be of a certain file type (png or jpg for example). The likely cause of this is that the images are not the file type that their extension indicates. You can see what file type an image really is by running the Unix "file" command:
file *jpg | grep PNG
Running this command from a terminal in the directory that contains the images in question will check the file type of all files that contain jpg, and prints output if it contains PNG. Output will be similar to the following:
PNG image data, 197 x 256, 8-bit/color RGBA, non-interlaced
One can reverse this command to look for jpg files pretending to be png:
file *png | grep JPEG
If you find files in this state, you can rename the file with a new extension:
mv filename.png filename.jpg
This should resolve the issue of such images not displaying correctly in Internet Explorer.