Dr. Mark Humphrys

School of Computing. Dublin City University.

Online coding site: Ancient Brain

coders   JavaScript worlds

Search:

Free AI exercises


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: 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: 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:


ancientbrain.com      w2mind.org      humphrysfamilytree.com

On the Internet since 1987.      New 250 G VPS server.

Note: Links on this site to user-generated content like Wikipedia are highlighted in red as possibly unreliable. My view is that such links are highly useful but flawed.