Hacker Newsnew | past | comments | ask | show | jobs | submit | mzur's commentslogin

Browsers starting to rotate images based on EXIF is such a pain. I maintain an image annotation tool and all of a sudden images were shown differently to users depending on the browser they used. Then you have to jump through all sorts of hoops to ignore the EXIF orientation again. In some cases you are not allowed to see if the orientation was changed for security reasons. And then the only way to control this is through a CSS attribute which only works if the element is in the DOM.


The amount of time I've spent dealing with this over the years is just incredible.. It's gotten to the point where during ingestion we auto-rotate everything just in case and strip out exif orientation metadata and never have to deal with it again.


This is the correct approach in my opinion. Metadata should not be used to control rotation - there are just too many edge cases for where it can go wrong.


Yes, came to the same conclusion - it's a pain, but solves the problem permanently.


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.


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.


Isn't this only true for images where the resolution is divisible by the block size or something like that?

IIRC in other cases you have to cut the edge of the image off (rounded to the nearest block) or recompress those edge blocks


Is that still true if the image dimensions aren't a multiple of the block size?


> In some cases you are not allowed to see if the orientation was changed for security reasons.

This is only true for cross-origin images, no? Which is expected: you can't access data loaded from another origin unless it's been loaded with CORS.


Isn't it a touch on the required side, though? I'm assuming the orientation is a common metadata element of phone produced images, in particular. I'd assume same for decent cameras.

Would love to see a good rundown of when you should rely on different approaches? Another thread pointed out that you should also use the color space metadata.


Some systems seem to produce images where the pixel arrangement matches the sensor layout, which moves when you rotate the device, and they'll add EXIF metadata to indicate the orientation.

Other cameras and phones and apps produce images where the device adjusts the aspect ratio and order of the array of pixels in the image regardless of the way the sensor was pointed, such that the EXIF orientation is always the default 0-degree rotation. I'd argue that this is simpler, it's the way that people ignorant of the existence of the metadata method would expect the system to work. That method always works on any device or browser, rotating with EXIF only works if your whole pipeline is aware of that method.


The advantage of the EXIF approach is you don't have to do nearly as much post processing of the data? In particular, I don't expect my camera application to need to change memory layout just because I have rotated my camera. So, if you want it to change the rows/columns on saving the image, that has to be post capture from the sensor. Right?

I think this is what you meant by "some systems" there. But, I would expect that of every sensor system? I legit never would have considered that they would try the transpose on saving the image off the sensor.


The transpose is absolutely trivial compared to debayering and compression. It's a lot simpler to do it upfront and not worry about rotation at any later point.

And the odds are very high your camera app did already switch memory layouts when you rotated, at least for the UI. Doing that isn't a big deal.


I mean, I get that it isn't incredibly difficult, but it still feels unnecessary. The cynic in me thinks this explains a bit of why the app based cameras are garbage.

Do you expect the same when recording video if the user rotates the device while recording? Timestamping an orientation flag is trivial. Why not lean on that?


Video that rotates partway through doesn't have a trivial answer for how you're supposed to display it.

For anything that has a consistent orientation, storing it that way removes a bunch of annoying edge cases and is very simple to implement.


I maintain a photo library project, I feel your pain. JPEG format is so crooked in so many ways.

It's shame that after so many years of development we ended up with such horrible formats like jpeg and mp4.


They wrote about this recently. With "Panorama" [1] they want to introduce an SQLite DB for all messages that will also be responsible for the search index.

[1] https://blog.thunderbird.net/2025/10/video-conversation-view...


I'm a happy user of my second Tuxedo laptop after using the first for over 7 years, repairing several parts. I found their support very responsive and spare parts affordable. Your points are valid though. If you don't like their custom stuff, the device also works fine with a stock Linux install (Ubuntu in my case).


They're also the only OEM that replied to me when I was trying to reverse engineer a similar laptop to theirs. I think that alone should put them into a league of their own. Only two companies have ever properly replied to me when I asked about source code or hardware documentation: one is a chinese company, the other is Tuxedo.


If you need a web app to mark/count things in images, search for "image annotation" tools. I know first hand of a tool that is around since 2009 and still maintained.


If you liked the article, please consider a donation to Damn Interesting. They recently announced taking a break [1] because of a shortfall of donations. DI has been such a great resource for interesting articles (to me) and it would be sad to see it wither away.

[1] https://www.damninteresting.com/breaking-a-bit/


I see they have a workspaces applet that has "row" and "column" in the source code. I'd love to see a GNOME-like DE that supports 2D workspaces again so I can happily abandon my GNOME extension (Workspace Matrix).

I couldn't figure out how to run COSMIC so I couldn't test if the applet really supports 2D workspaces, though.


I use this shell script with a cron job: https://gist.github.com/rodw/3073987 It can back up repos, issues and wikis.


I just use good old Thunderbird.


So do I, since I'm subscribed to a lot of email newsletters and it's nice to have them all together, but the lack of sync between devices is annoying


Can you recommend me any newsletters?

Thanks in advance.


I'm subscribed to Matt Levine's Money Stuff[0] about finance, computers are bad[1] about retrotechnology, and A Collection of Unmitigated Pedantry[2] about history. The common theme through all of these is their focus on big picture systems, which I enjoy. I'm also subscribed to the Orbital Index[3] which is about space, and is more focused on small scale current events than the others.

[0] https://www.bloomberg.com/account/newsletters/money-stuff

[1] https://computer.rip, run by https://news.ycombinator.com/user?id=jcrawfordor

[2] https://acoup.blog

[3] https://orbitalindex.com/


Thank you so much for google-webfonts-helper! It's been helping me a lot recently ever since there was this questionable court decision in Germany that using fonts directly from Google violates the privacy regulation and website owners were sued all over the place.


You havent by any chance been sued by some weird lawyer from a german capital whose name pops up all over google on researching this in the name of a person that does not really seem to exist?

They are fraudulently trying to trick people in paying ~170 euro without any clear statement on what is their claim. Dont fall for it.


I haven't been sued personally but some of my clients were. I told everyone to ignore it but had to update their websites nonetheless.


I like to use Spotify Release List [1] which is also a good replacement for the Spotify Release Radar. It just watches for artists you follow and doesn't include those that buy their way into the Release Radar (I'm looking at you, Ed).

[1] https://spotifyreleaselist.netlify.app


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: