←back to thread

94 points justin-reeves | 6 comments | | HN request time: 0.207s | source | bottom
1. rkagerer ◴[] No.46005944[source]
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.

replies(3): >>46006024 #>>46008635 #>>46009719 #
2. lxgr ◴[] No.46006024[source]
> 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.

3. OptionOfT ◴[] No.46008635[source]
> 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.

What if I want to rotate an image by 90 degrees because my camera didn't correctly detect up & down?

To my understanding rotation is lossless, where as moving the data will incur quality loss (except for certain exceptions).

replies(1): >>46010131 #
4. tehjoker ◴[] No.46009719[source]
Eh, the coordinate frame can really be anything. It's important to disambiguate what is really meant. The convention in images is that images are +X-Y, but for certain applications, the PNG may represent data that is +X+Y, or mirrored -X+Y, landscape, or portrait. Is the coordinate system the camera coordinates or the world coordinates?

It's true that automatic handling of all input images is difficult, but imo it's important to document.

An example I recently encountered is that in neurological imaging, the axes are patient's right, anterior, superior whereas in radiology they are patient's left, anterior superior. Tricky to get right...

http://www.grahamwideman.com/gw/brain/orientation/orientterm...

replies(1): >>46010180 #
5. lxgr ◴[] No.46010131[source]
JPEG rotation can be lossless for certain image dimensions (multiples of 8 or 16 pixels respectively, depending on chroma subsampling).

I suppose it's no coincidence that the native output format of many sensors (or ISPs, to be precise) is divisible by 16 in both width and height.

6. lxgr ◴[] No.46010180[source]
> Eh, the coordinate frame can really be anything.

Well, in JPEG, there's exactly one coordinate frame in the absence of EXIF metadata: Left to right, top to bottom. So there's really only one.