frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Resizing images in Rust, now with EXIF orientation support

https://alexwlchan.net/2025/create-thumbnail-is-exif-aware/
33•ingve•3d ago

Comments

esperent•1h ago
I'm sure there's very good reasoning but I've never been able to convince myself of it - why does EXIF transform metadata exist? If you're taking a selfie, why doesn't the camera itself perform a simple rotation or mirror of the actual image data rather than using EXIF?
tinco•1h ago
I think it does this after the photo has already been stored as JPEG. I think users would expect the image be persisted the moment you capture it, so any transformations after that are better done in metadata. When the image has been saved as JPEG the original image data is discarded so you can't transform without deteriorating the image.
dividuum•1h ago
Pretty sure you can rotate JPEG images lossless. But it’s still simpler to just modify metadata.
perching_aix•25m ago
A quick search suggests to me that it's only a lossless process if the image dimensions are a clean integer multiple of 8 (as the blocks are 8x8), otherwise the edges must be reencoded. Never written a JPEG codec though, so happy to be proven wrong.
Doohickey-d•1h ago
One reason I can think of: when you rotate an image in the windows photo viewer (and probably lots of other apps), it stores that in the EXIF metadata. So the rotation is lossless, by not having to re-compress the JPEG.

I could also imagine that the earliest digital cameras wouldn't have had the processing power, or RAM to store the entire image in memory after reading it from the sensor, in order to do such a rotation. Hence EXIF rotation as a cheap alternative.

esperent•27m ago
You can rotate (in 90 degree increments) and mirror jpgs losslessly. I assume it doesn't require much ram or compute since you're just reordering the blocks.

https://www.betterjpeg.com/lossless-rotation.htm

perching_aix•3m ago
Having read that article, I'd say this is not really an honest takeaway.

They offer three "solutions" to the issue of partial blocks:

- cut them off and stop worrying about it

- show whatever the original JPEG encoder put there and stop worrying about it

- replace whatever the original JPEG encoder put there and stop worrying about it

I cannot imagine anyone honestly considering these and then shipping them. It's fine if the user manually consents, but automated, this is pretty objectionable. Extending the image in arbitrary ways or cutting off of it is really not what I'd expect from a codec to do when I ask it to perform a lossless transformation, particularly specific ones, like flip and rotate.

blululu•32m ago
I too have always found this strange but I have never found a solid reason. Having an explicit declaration of intent is not a terrible feature in a data type so this is not exactly a bad choice. Also this means that a camera roll from a single sensor can be stored as an array in C since every image has the exact same size. It also does make life easier for the camera developers (but harder for photo viewer developers). If anyone knows the history here I would actually really be interested.
jcynix•16m ago
You can transfer EXIF information, including the rotation info, with either exiftool or ImageMagick into a thumbnail, to let other software know how to display it correctly.

If you want to rotate a jpeg yourself (which is easily done with "magic in.jpg rotate 90 out.jpg" and, of course, other software) but lossless, there's https://jpegclub.org/jpegtran/ which accomplishes it.

When generating rotated thumbnails (without caring for "lossless") the best strategy in my experience is to first rotate the large original image and then generate the thumbnail afterwards, because image resizing will most often hide any rotation artifacts anyways.

ginko•5m ago
Wouldn't it make more sense if `image::open()` automatically applied the orientation by default?

SkiftOS: A hobby OS built from scratch using C/C++ for ARM, x86, and RISC-V

https://skiftos.org
137•ksec•5h ago•18 comments

UTF-8 is a brilliant design

https://iamvishnu.com/posts/utf8-is-brilliant-design
569•vishnuharidas•15h ago•234 comments

How to Use Claude Code Subagents to Parallelize Development

https://zachwills.net/how-to-use-claude-code-subagents-to-parallelize-development/
87•zachwills•3d ago•48 comments

Resizing images in Rust, now with EXIF orientation support

https://alexwlchan.net/2025/create-thumbnail-is-exif-aware/
33•ingve•3d ago•10 comments

Social media promised connection, but it has delivered exhaustion

https://www.noemamag.com/the-last-days-of-social-media/
143•pseudolus•3h ago•93 comments

QGIS is a free, open-source, cross platform geographical information system

https://github.com/qgis/QGIS
424•rcarmo•17h ago•104 comments

FFglitch, FFmpeg fork for glitch art

https://ffglitch.org/gallery/
193•captain_bender•12h ago•27 comments

Many hard LeetCode problems are easy constraint problems

https://buttondown.com/hillelwayne/archive/many-hard-leetcode-problems-are-easy-constraint/
516•mpweiher•19h ago•439 comments

Raspberry Pi Synthesizers – How the Pi is transforming synths

https://www.gearnews.com/raspberry-pi-synthesizers-how-the-pi-is-transforming-synths/
50•zdw•6h ago•25 comments

Weird CPU architectures, the MOV only CPU (2020)

https://justanotherelectronicsblog.com/?p=771
9•v9v•3d ago•0 comments

The treasury is expanding the Patriot Act to attack Bitcoin self custody

https://www.tftc.io/treasury-iexpanding-patriot-act/
684•bilsbie•22h ago•491 comments

Life, work, death and the peasant: Rent and extraction

https://acoup.blog/2025/09/12/collections-life-work-death-and-the-peasant-part-ivc-rent-and-extra...
196•baud147258•8h ago•84 comments

I used standard Emacs extension-points to extend org-mode

https://edoput.it/2025/04/16/emacs-paradigm-shift.html
157•Karrot_Kream•13h ago•18 comments

Tips for installing Windows 98 in QEMU/UTM

https://sporks.space/2025/08/28/tips-for-installing-windows-98-in-qemu-utm/
87•Bogdanp•11h ago•14 comments

Meow: Yet another modal editing on Emacs

https://github.com/meow-edit/meow
93•Bogdanp•9h ago•16 comments

Behind Kamathipura's Closed Doors

https://failedarchitecture.com/behind-kamathipuras-closed-doors/
8•tsaifu•3d ago•1 comments

EU court rules nuclear energy is clean energy

https://www.weplanet.org/post/eu-court-rules-nuclear-energy-is-clean-energy
809•mpweiher•15h ago•686 comments

Nepal picks a new prime minister on a discord server days after social media ban

https://www.nytimes.com/2025/09/11/world/asia/nepal-protest-genz-discord.html
60•fivestones•3h ago•31 comments

Java 25's new CPU-Time Profiler (1)

https://mostlynerdless.de/blog/2025/06/11/java-25s-new-cpu-time-profiler-1/
3•SerCe•2h ago•0 comments

3D modeling with paper

https://www.arvinpoddar.com/blog/3d-modeling-with-paper
282•joshuawootonn•19h ago•43 comments

Legal win

https://ma.tt/2025/09/legal-win/
180•pentagrama•8h ago•144 comments

OCI Registry Explorer

https://oci.dag.dev/
54•jcbhmr•7h ago•7 comments

AI Coding

https://geohot.github.io//blog/jekyll/update/2025/09/12/ai-coding.html
8•abhaynayar•43m ago•0 comments

Chatbox app is back on the US app store

https://github.com/chatboxai/chatbox/issues/2644
47•themez•7h ago•18 comments

Reduce bandwidth costs with dm-cache: fast local SSD caching for network storage

https://devcenter.upsun.com/posts/cut-aws-bandwidth-costs-95-with-dm-cache/
56•tlar•3d ago•17 comments

How FOSS Projects Handle Legal Takedown Requests

https://f-droid.org/2025/09/10/how-foss-projects-handle-legal-takedown-requests.html
120•mkesper•16h ago•10 comments

Discovery of a new satellite or ring arc around Quaoar

https://phys.org/news/2025-09-discovery-moon-orbiting-mysterious-distant.html
39•wglb•1d ago•8 comments

Antlr-Ng Parser Generator

https://www.antlr-ng.org/
36•djoldman•3d ago•13 comments

California lawmakers pass SB 79, housing bill that brings dense housing

https://www.latimes.com/california/story/2025-09-12/california-lawmakers-pass-sb-79-housing-bill-...
188•mji•8h ago•73 comments

Corporations are trying to hide job openings from US citizens

https://thehill.com/opinion/finance/5498346-corporate-america-has-been-trying-to-hide-job-opening...
545•b_mc2•17h ago•408 comments