Dr. Mark Humphrys

School of Computing. Dublin City University.

Home      Blog      Teaching      Research      Contact

Search:

CA216      CA249      CA318

CA400      CA651      CA668


Web browsers - Chrome image bug


Chrome bug - image rotated

This is an issue with Chrome displaying images rotated wrongly (e.g. at a 90 degree angle).

This issue is finally understood. (Thanks to Curnan Reidy and Brian Rice.)
It is not perhaps a Chrome "bug". Rather it is Chrome's decision on how to deal with buggy images.

Some images, rotated with buggy software, may end up with a bad "Orientation" value in their EXIF meta-data.
This was never noticed because most software ignores the "Orientation" tag. But the new version of Chrome on Windows does not ignore the "Orientation" tag, and will rotate the image if you link to it, but not rotate it if you embed it on a page (for backward compatibility).





Test image - Orientation 90

Image: http://computing.dcu.ie/~humphrys/Bitmaps/4.jpg
ExifTool shows EXIF data for this image as:
Exif Image Height               : 330
Exif Image Width                : 1600
Image Height                    : 330
Image Size                      : 1600x330
Image Width                     : 1600
Orientation                     : Rotate 90 CW

This image was rotated from the original and saved.
The rotation is shown in the correct EXIF height and width.
But the rotation has left an unfortunate trace in the EXIF orientation.


Embed image displays correctly


Link to image displays wrong

Link to image



Test image - Orientation Normal

Using my image viewer I rotated the above image and rotated back.
Now it displays correctly.

New image: http://computing.dcu.ie/~humphrys/Bitmaps/5.jpg
ExifTool shows EXIF data for this image as:

Exif Image Height               : 330
Exif Image Width                : 1600
Image Height                    : 330
Image Size                      : 1600x330
Image Width                     : 1600
Orientation                     : Horizontal (normal)

Embed image displays correctly


Link to image displays correctly

Link to image



Solution

The solution is to hunt for all such images and fix them.
Can do a command-line search using ExifTool: Then perhaps (by hand) rotate them and rotate back until the "Orientation" value is normal.
Or even better (by program) use ExifTool to automatically delete the "Orientation" tag:


Feeds      w2mind.org

On Internet since 1987.