Live data from Hacker News

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

bugzilla.mozilla.org

51–60 of 91 posts

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

#51

Earlier quoted context omitted.

Wouldn’t that degrade the quality for a lossy format, especially if done repeatedly? I see why people would not want their phone to do that. If you’re uploading it somewhere that might not be supported it would be worth it but I don’t want my phone to silently degrade images that are just sitting in my gallery

JPEG allows for lossless 90 degree rotation, not sure about other formats

Pretty sure that any software from after ~2005 that supports image rotation, isn’t doing so at decoding time, but rather is decoding the image into a GPU texture buffer and then rotating the quad that texture gets applied to. Which should always be lossless for multiple-of-90-degree rotations. (Presuming that the image doesn’t depend on sub-pixel rendering tricks.)

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

#52
post #35

Earlier quoted context omitted.

Yes. I wrote a little image uploader script to easily upload images from my phone for embedding in web forums etc, and it strips out all the EXIF orientation and just converts it to the correct orientation. Aside from that I'm always having to fiddle with it in my image tools and hope every software I use supports it. It's such a crap feature. Just rotate the damn image, phones!

Wouldn’t that degrade the quality for a lossy format, especially if done repeatedly? I see why people would not want their phone to do that. If you’re uploading it somewhere that might not be supported it would be worth it but I don’t want my phone to silently degrade images that are just sitting in my gallery

Rotate it at capture time, before encoding. This would get rid of like 95% of these exif orientation tags. For images that need to be manually rotated after for whatever reason, sure I guess you have a point, though I'd argue the quality loss would be unnoticeable in practice unless you're like spinning the image in circles 100 times for some reason.

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

#53

Earlier quoted context omitted.

I firmly believe every product team needs to be split in two: one half works on the issue of highest importance, the other works on the easiest issues. If only to avoid the embarrassment of easy to fix bugs that were passed over for eons just because they weren't priority-high.

I don't this makes business sense in general. I do however think that there are quite a few bugs that might be triaged as "easy" but if worked on would reveal much more serious problems. Which is why some random selection of "easy" issues should make it to work queues.

Makes business sense if you want to fill in developers down time - instead of waiting for CR or QA feedback pick up small bug.

Working on two or more big features at the same time is not possible. But throwing in some pebbles and dev can take on it.

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

#54
Orientation in EXIF was an ugly hack and we're living with its fallout today.

Cameras should have just rotated the actual image pixels when saving, instead of cheating. If that's too slow, implement it in hardware, or schedule a deferred process and don't let the images be exported until that's done.

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

#55
post #51

Earlier quoted context omitted.

JPEG allows for lossless 90 degree rotation, not sure about other formats

Pretty sure that any software from after ~2005 that supports image rotation, isn’t doing so at decoding time, but rather is decoding the image into a GPU texture buffer and then rotating the quad that texture gets applied to. Which should always be lossless for multiple-of-90-degree rotations. (Presuming that the image doesn’t depend on sub-pixel rendering tricks.)

Even without a GPU, the JPEG format itself allows for totally lossless rotation. It is also quite fast, and doesn't require reading and writing every pixel in the image.

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

#56

Orientation in EXIF was an ugly hack and we're living with its fallout today. Cameras should have just rotated the actual image pixels when saving, instead of cheating. If that's too slow, implement it in hardware, or schedule a deferred process and don't let the images be exported until that's done.

> Orientation in EXIF was an ugly hack and we're living with its fallout today.

No, it was an elegant hack given all the constraints which mostly no longer exist on modern hardware (although I wouldn't be so sure about really small embedded systems).

Sure, modern cameras will have no issues loading the full JPEG into memory, but how would you have implemented this in cameras that only have enough for exactly one line's worth of compression blocks?

> or schedule a deferred process and don't let the images be exported until that's done.

Good luck doing this on a battery-powered camera writing directly to an SD card that's expected to be mountable after removing it from the camera without an intransparent postprocessing step.

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

#57
post #13

Earlier quoted context omitted.

There's something to this, although I think the idea needs some refinement. Anyone who's worked on a real software product knows that the "easy" bugs usually aren't actually easy (or else they would've been fixed already!). The way I've seen it implemented at a small company I worked at before was to explicitly endorse the "20% time" idea that Google made famous, where you may choose your own priorities for a fractio…

> Anyone who's worked on a real software product knows that the "easy" bugs usually aren't actually easy (or else they would've been fixed already!). Not really. It's hard to see the difference from the outside without actually digging into it first, but in my experience while there's plenty of "easy" bugs that aren't actually easy, there's also plenty of easy bugs that are actually easy and that apparently everyone…

Easy bugs might exist at small and medium size companies, but when you are a $1T+ company, there is no such thing as an easy fix. Your change could have unforeseen side effects that take down some critical revenue-generating service that causes us to lose $millions. It's got to go through multiple code reviews, have unit and integration tests written, be able to show those test passing more than once, it may need to get reviewed by legal, it may need to get reviewed by security and privacy teams. And tons of other process overhead I'm not even recalling. Just getting a one-liner from an engineer's fingertips properly deployed into production could take months.

Whether or not you fix a bug weighs on the scale against the cost of all of the above things, the cost of time, the cost of these people's attention, and the opportunity cost of them doing something else. And these costs tend to not scale with the size of the pull request. They're fixed costs that have to be paid no matter how small an issue is.

I work at a BigCo, and occasionally get comments from developer friends about "Hey, why doesn't BigCo fix this obvious bug I reported! It's simple! Why are you guys so incompetent??" I look at the bug internally, and it's either 1. got a huge internal comment chain showing it's not as simple as an outsider would think, or 2. it's indeed trivial, but the effort to fix it does not outweigh the costs I outlined above.

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

#58
I remember EXIF orientation in JPEG also took a few years to get fixed:

https://issues.chromium.org/issues/40448628

When it got fixed, some sites were still depending on the old behavior of not rotating JPEGs, and had to add "image-orientation:none" to explicitly ignore EXIF:

https://issues.chromium.org/issues/40716313

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

#59

As a former metadata completionist, my mind starts to dissociate when I think about my battles with EXIF metadata, vendor-specific metadata, and the way different software supports, or refuses to support, any of it. It gets even worse when ingesting images into Apple Photos, where you have to confront papercut bugs that you know will never be fixed. I love ExifTool. It’s one of the great utilities. It works for almos…

I've been trying to create clean metadata for a collection of Blu-ray rips recently. The MKV format has a bunch of defined metadata fields but handling of it is inconsistent between players. VLC seems to be the worst in that it doesn't even bother displaying important pieces of the metadata. You can work around that by effectively duplicating the important parts in the track name, but then other software ends up doubling up on that because it's displaying both the track name and the values pulled from the other track metadata. And I'm being driven crazy on how I should use the subtitle track flags that indicate if a track is Forced or Default, because it seems like the auto-selection behavior based on those flags arbitrary from player to player.

I should probably just give up and let it all be a mess. Not sure I'll be able to though. The only thing that freed me from metadata obsession when it came to my music collection is that I switched to streaming services.

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

#60

As a former metadata completionist, my mind starts to dissociate when I think about my battles with EXIF metadata, vendor-specific metadata, and the way different software supports, or refuses to support, any of it. It gets even worse when ingesting images into Apple Photos, where you have to confront papercut bugs that you know will never be fixed. I love ExifTool. It’s one of the great utilities. It works for almos…

> It gets even worse when ingesting images into Apple Photos, where you have to confront papercut bugs that you know will never be fixed.

I wish they open-sourced their built-in macOS apps.

Post reply on HN