Open Bug 1627423 Opened 4 years ago Updated 1 month ago

EXIF orientation info in PNGs isn't used for image-orientation: from-image

Categories

(Core :: Layout: Images, Video, and HTML Frames, defect, P3)

76 Branch
defect

Tracking

()

People

(Reporter: e, Unassigned)

References

(Blocks 3 open bugs)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1 Safari/605.1.15

Steps to reproduce:

Go to https://ericportis.com/etc/PNG-EXIF-orientation/

Actual results:

The JPEG and PNG are rotated differently, even though they both have the same EXIF info (Orientation: Rotate 90 CW), and are both set to image-orientation: from-image;

Expected results:

They should display the same.

Further findings: neither Safari, Chrome, or Firefox respects exiftool's default output, which appends EXIF to the end of a PNG. This is allowed by the spec, but seems to be incompatible with progressive rendering of partially-downloaded PNGs.

Safari does respect EXIF orientation info that appears before the image data, but Firefox and Chrome do not.

https://bugs.webkit.org/show_bug.cgi?id=210021#c4
https://ericportis.com/etc/PNG-EXIF-orientation/shuffling-chunks/

heycam: Will this be covered by any of your follow-up work related to bug 1607667?

Status: UNCONFIRMED → NEW
Component: Untriaged → Layout: Images, Video, and HTML Frames
Ever confirmed: true
Flags: needinfo?(cam)
Priority: -- → P3
Product: Firefox → Core

Huh, I didn't even know that PNG supported orientation data. I found https://ftp-osl.osuosl.org/pub/libpng/documents/pngext-1.5.0.html#C.eXIf which defines the eXif table. The patches I'm working on don't add support for this, but it would not be too difficult to do so, at least if the table appears earlier than the image data. (I don't think our current image loading flow would handle the image size changing as a result of the orientation data later on.)

Flags: needinfo?(cam)

Because this bug's Severity has not been changed from the default since it was filed, and it's Priority is P3 (Backlog,) indicating it has been triaged, the bug's Severity is being updated to S3 (normal.)

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.