frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

I Write Games in C (yes, C)

https://jonathanwhiting.com/writing/blog/games_in_c/
45•valyala•2h ago•19 comments

We Mourn Our Craft

https://nolanlawson.com/2026/02/07/we-mourn-our-craft/
228•ColinWright•1h ago•244 comments

SectorC: A C Compiler in 512 bytes

https://xorvoid.com/sectorc.html
31•valyala•2h ago•4 comments

Hoot: Scheme on WebAssembly

https://www.spritely.institute/hoot/
128•AlexeyBrin•8h ago•25 comments

Brookhaven Lab's RHIC Concludes 25-Year Run with Final Collisions

https://www.hpcwire.com/off-the-wire/brookhaven-labs-rhic-concludes-25-year-run-with-final-collis...
8•gnufx•1h ago•1 comments

The AI boom is causing shortages everywhere else

https://www.washingtonpost.com/technology/2026/02/07/ai-spending-economy-shortages/
132•1vuio0pswjnm7•9h ago•160 comments

Stories from 25 Years of Software Development

https://susam.net/twenty-five-years-of-computing.html
71•vinhnx•5h ago•9 comments

OpenCiv3: Open-source, cross-platform reimagining of Civilization III

https://openciv3.org/
836•klaussilveira•22h ago•251 comments

U.S. Jobs Disappear at Fastest January Pace Since Great Recession

https://www.forbes.com/sites/mikestunson/2026/02/05/us-jobs-disappear-at-fastest-january-pace-sin...
181•alephnerd•2h ago•124 comments

Al Lowe on model trains, funny deaths and working with Disney

https://spillhistorie.no/2026/02/06/interview-with-sierra-veteran-al-lowe/
57•thelok•4h ago•8 comments

The Waymo World Model

https://waymo.com/blog/2026/02/the-waymo-world-model-a-new-frontier-for-autonomous-driving-simula...
1064•xnx•1d ago•613 comments

Reinforcement Learning from Human Feedback

https://rlhfbook.com/
85•onurkanbkrc•7h ago•5 comments

Start all of your commands with a comma (2009)

https://rhodesmill.org/brandon/2009/commands-with-comma/
493•theblazehen•3d ago•178 comments

Vocal Guide – belt sing without killing yourself

https://jesperordrup.github.io/vocal-guide/
215•jesperordrup•12h ago•77 comments

Show HN: I saw this cool navigation reveal, so I made a simple HTML+CSS version

https://github.com/Momciloo/fun-with-clip-path
14•momciloo•2h ago•0 comments

Coding agents have replaced every framework I used

https://blog.alaindichiappari.dev/p/software-engineering-is-back
231•alainrk•7h ago•366 comments

France's homegrown open source online office suite

https://github.com/suitenumerique
577•nar001•6h ago•261 comments

Selection Rather Than Prediction

https://voratiq.com/blog/selection-rather-than-prediction/
9•languid-photic•3d ago•1 comments

A Fresh Look at IBM 3270 Information Display System

https://www.rs-online.com/designspark/a-fresh-look-at-ibm-3270-information-display-system
41•rbanffy•4d ago•8 comments

72M Points of Interest

https://tech.marksblogg.com/overture-places-pois.html
30•marklit•5d ago•3 comments

History and Timeline of the Proco Rat Pedal (2021)

https://web.archive.org/web/20211030011207/https://thejhsshow.com/articles/history-and-timeline-o...
19•brudgers•5d ago•4 comments

Unseen Footage of Atari Battlezone Arcade Cabinet Production

https://arcadeblogger.com/2026/02/02/unseen-footage-of-atari-battlezone-cabinet-production/
114•videotopia•4d ago•35 comments

Where did all the starships go?

https://www.datawrapper.de/blog/science-fiction-decline
80•speckx•4d ago•91 comments

Show HN: Look Ma, No Linux: Shell, App Installer, Vi, Cc on ESP32-S3 / BreezyBox

https://github.com/valdanylchuk/breezydemo
278•isitcontent•22h ago•38 comments

Learning from context is harder than we thought

https://hy.tencent.com/research/100025?langVersion=en
201•limoce•4d ago•112 comments

Monty: A minimal, secure Python interpreter written in Rust for use by AI

https://github.com/pydantic/monty
289•dmpetrov•23h ago•156 comments

Hackers (1995) Animated Experience

https://hackers-1995.vercel.app/
558•todsacerdoti•1d ago•272 comments

Making geo joins faster with H3 indexes

https://floedb.ai/blog/how-we-made-geo-joins-400-faster-with-h3-indexes
155•matheusalmeida•2d ago•48 comments

Sheldon Brown's Bicycle Technical Info

https://www.sheldonbrown.com/
431•ostacke•1d ago•111 comments

Microsoft Account bugs locked me out of Notepad – are Thin Clients ruining PCs?

https://www.windowscentral.com/microsoft/windows-11/windows-locked-me-out-of-notepad-is-the-thin-...
7•josephcsible•30m ago•1 comments
Open in hackernews

Resizing images in Rust, now with EXIF orientation support

https://alexwlchan.net/2025/create-thumbnail-is-exif-aware/
78•ingve•5mo ago

Comments

esperent•4mo 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•4mo 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•4mo ago
Pretty sure you can rotate JPEG images lossless. But it’s still simpler to just modify metadata.
perching_aix•4mo 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 or 16 (as the blocks can be 8x8, 8x16, 16x8, or 16x16), otherwise the edges must be reencoded. Never written a JPEG codec though, so happy to be proven wrong.
addaon•4mo ago
This is true, and others have mentioned it, but I think people are underestimating just how universal sensor dimensions being a multiple of 16 is — I really can’t think of any exceptions.
Doohickey-d•4mo 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•4mo 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•4mo ago
Having read that article, I'd say this is not really an honest takeaway. I mean, I guess it is lossless, it just really flies in the face of what I'd consider reasonable baseline expectations.

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, which I'd expect to be outright periodic. And periodicity is violated immediately with the dimensions changing.

esperent•4mo ago
Does the issue of partial blocks come up for any real world sensor sizes?
perching_aix•4mo ago
Considering I'd need to enumerate every single sensor in former or current production to answer that, that's a very good question indeed. I have no idea dude.

Are all JPEGs photos, following sensor pixel dimensions?

blululu•4mo 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.
YesThatTom2•4mo ago
You need to appreciate how little RAM and CPU power those cameras have.

As far as cost:

Applying the right tag: 0

Anything else: not 0

Why not include a faster CPU or more RAM? In an industry where people pick one product over the other because of a $10 price difference, you’re never going to convince management to approve the better CPU when a tag solves the problem.

These are hardware companies. They look at software as a nuisance. “fix it in software” is for the downstream.

pessimizer•4mo ago
I don't know why I should have a preference when it comes to the memory layout of an image. If metadata tells be to orient it this way, I'll orient it this way, if that way, then that way. It seems weird and wasteful to me (and potentially prone to error) to want to reorder the data in order to change the display orientation.

I can only imagine caring when it comes to streaming a very large image serially, and then I still have no idea what preference I would have (other than that I get the metadata first.)

As an analogy, if I have some irreplaceable video that has a bad aspect ratio, I fix it in the metadata, I don't transcode it. The data is a blob, the metadata is what tells me how to display it (even if it's just the mimetype.)

kevincox•4mo ago
There are sort of two questions here:

> why does EXIF transform metadata exist?

Because there are times when it is useful to be able to quickly and losslessly rotate a photo. For example an image viewer might provide quick options to rotate a photo (in case it did end up rotated the wrong way originally).

Probably this should just have been part of the actual image format rather than metadata, but that isn't how it played out.

> why doesn't the camera itself perform a simple rotation or mirror

There could be various reasons. The simplest is that adjusting the rotation naturally happens later in the pipeline than lossy encoding. You don't want to re-encode for quality and performance reasons so just slap on the metadata. The other could be that it is less expensive to avoid rotating. In many cameras the encoding is handled by specialized hardware, adding a way to rotate the raw pixels is likely more expensive than always having the source pixel map to the same input pixel in the encoder. There is no hard reason it couldn't be done, but in many situations it is cheaper to do it this way.

jcynix•4mo 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.

kevincox•4mo ago
But it seems that if you are re-encoding the image anyways it is best to just generate it in the "correct" orientation and skip this metadata. Emitting the metadata seems mostly useful if you are trying to avoid re-encoding the image.

Or is there a benefit to generating the thumbnail in the original rotation then preserving the metadata?

jcynix•4mo ago
Sure, generating the "correct" format would be a good decision. When you change pixel orientation, you'll need to either update or clear the EXIF orientation info to reflect the new pixel data.

Rotation metadata might be helpful in (larger) thumbnails when images are displayed on mobile devices and responsive web pages. Metadata is easy to transfer, at least when scripting with Exiftool or ImageMagick.

radicality•4mo ago
Is jpeg the only format which can be “rotated losslessly” in this way, ie without exif metadata (and excluding any obvious formats like bitmaps or whatever can be trivially rotated) ?
jcynix•4mo ago
Both PNG and Webp exist in lossless formats which can be easily rotated without loss of quality. Jpeg is different, because its internal structure consists of 8x8 blocks (which, BTW, can be rotated lossless if both sides of the image are multiples of 8, iirc.

For photos all these assumptions are rather theoretical IMO, because modern cameras create images in sizes which almost always have to be reduced in size for viewing, unless one wants to pixel-peep.

taosx•4mo ago
From what I know it can't be "rotated losslessly" in all cases, only if the dimensions of the images are multiples of the MCU which are block of pixels whose size is determined by the chroma subsampling. Ex.: With the common "4:2:0" subsampling the MCU is 16x16 the image's height and width must be exactly multiples of 16, otherwise I think it's just visually lossless and uses some tricks that I'm still not sure how they work.
ginko•4mo ago
Wouldn't it make more sense if `image::open()` automatically applied the orientation by default?
hn92726819•4mo ago
Probably for a higher-level crate, (like the one the author wrote), but it adds computational complexity, and you don't want that by default with a low level crate like `image`.

For example, if you wanted to blur or grayscale an image, do you really want to rotate it? When you re-save it, you'll have to remove the exif rotation metadata too.

jcupitt•4mo ago
Applying rotation can have a large performance penalty (both cpu and memory), so you want to be able to avoid it if possible.
pornel•4mo ago
The rexif crate supports editing, so you can apply rotation when resizing, and then remove the rotation tag from the EXIF data. Keeping EXIF isn't necessary for small thumbnails, but could be desirable for larger versions of the image.
ddahlen•4mo ago
One good reason to keep the raw data and orientation separate is hardware calibrations. I see some discussion here along the lines of "why not just flip the data before saving it", and one counter-argument is that you should store the flip metadata anyways, as it important to trace which hardware pixel corresponds to which stored pixel. I realize this information is not vital for everyone, but it is super useful in fields where you need to characterize the hardware performance at the pixel level (for example astronomy).
mentalgear•4mo ago
a wasm port available?
timeinput•4mo ago
If it's all in rust you can maybe probably compile it to wasm with out much effort. Kinda depends what libraries they used / how they factored their code etc.
vic1102•4mo ago
I ran into the same issue when working with image processing in Go using libvips. By default, libvips ignores EXIF orientation too, so I had to explicitly read and apply the orientation tag before doing any resize or crop. Otherwise users ended up with upside-down processed images from photos. Glad to see this is getting better in Rust.
jcupitt•4mo ago
Hello, libvips author here, the JPEG loader has a flag to do this for you. You can write:

VipsImage *image = vips_image_new_from_file("something.jpg", "autorotate", TRUE, NULL);

and it'll flip it upright for you and remove any EXIF orientation tag. It isn't the default since it has (obviously) a large memory and cpu cost.

For simple resize and crop it's much better to use the exif tag to adjust the resize and crop parameters (the vipsthumbnail command does this).

vic1102•4mo ago
Thanks so much for the clarification and for the great work on libvips!

In my Go project I’m using the Golang library github.com/davidbyttow/govips/v2.

Images are loaded via `vips.NewImageFromFile()`, which internally calls `vips_image_new_from_file()`. However, `NewImageFromFile()` doesn't support any flags or options beyond the image path, so for JPEGs I manually call `AutoRotate()` before resizing, which wraps `vips_autorot()` — and that works well.

Thanks again!

jcupitt•4mo ago
Ah no problem! I'm glad it's useful.

`govips` was a pretty early binding and wasn't really done the libvips way. It doesn't expose all the operations or options, it's mostly done by hand, and there are a number of leaks and misfeatures.

It's been replaced by `vipsgen`:

https://github.com/cshum/vipsgen

Which is an automatically generated 100% binding. It should have the complete API, it should be very stable and leak-free, and it should be simple to maintain.

`autorot` is pretty expensive. You'll see much better performance if you flip x and y in your crop instead.

vic1102•4mo ago
Thanks a lot! I really appreciate the detailed reply and the recommendation!

I wasn’t aware of `vipsgen`, but it looks great — full coverage and auto-generated bindings are exactly what I’ll be missing in `govips` if the project grows (I hope it will). I’ll definitely give it a try and see how it works.

Also, great tip on avoiding `autorot` by flipping crop coordinates — I hadn’t thought of that! Thanks again for your help!