←back to thread

A new PNG spec

(www.programmax.net)
616 points bluedel | 3 comments | | HN request time: 0.001s | source
Show context
qwertox ◴[] No.44373847[source]
> Officially supports Exif data

Probably the best news here. While you already can write custom data into a header, having Exif is good.

BTW: Does Exif have a magnetometer (rotation) and acceleration (gravity) field? I often wonder about why Google isn't saving this information in the images which the camera app saves. It could help so much with post-processing, like with leveling the horizon or creating panoramas.

replies(7): >>44373955 #>>44373957 #>>44373987 #>>44375555 #>>44376496 #>>44382700 #>>44384608 #
Aardwolf ◴[] No.44373955[source]
Exif can also cause confusion for how to render the image: should its rotation be applied or not?

Old decoders and new decoders now could render an image with exif rotation differently since it's an optional chunk that can be ignored, and even for new decoders, the spec lists no decoder recommendations for how to use the exif rotation

It does say "It is recommended that unless a decoder has independent knowledge of the validity of the Exif data, the data should be considered to be of historical value only.", so hopefully the rotation will not be used by renderers, but it's only a vague recommendation, there's no strict "don't rotate the image" which would be the only backwards compatible way

With jpeg's exif, there have also been bugs with the rotation being applied twice, e.g. desktop environment and underlying library both doing it independently

replies(1): >>44374585 #
DidYaWipe ◴[] No.44374585[source]
The stupid thing is that any device with an orientation sensor is still writing images the wrong way and then setting a flag, expecting every viewing application to rotate the image.

The camera knows which way it's oriented, so it should just write the pixels out in the correct order. Write the upper-left pixel first. Then the next one. And so on. WTF.

replies(4): >>44374826 #>>44375663 #>>44376252 #>>44378679 #
mavhc ◴[] No.44374826[source]
Because your non-smartphone camera doesn't have enough ram/speed to do that I assume (when in burst mode)

If a smartphone camera is doing it, then bad camera app!

replies(4): >>44374904 #>>44375115 #>>44375776 #>>44385606 #
1. joking ◴[] No.44375776{3}[source]
the main reason is probably that the chip is already outputting the image in a lossy format, and if you reorder the pixels you must reencode the image which means degrading the image, so it's much better to just change the exif orientation.
replies(2): >>44380600 #>>44382773 #
2. lsaferite ◴[] No.44380600[source]
> the chip is already outputting the image in a lossy format

Could you explain this one?

3. DidYaWipe ◴[] No.44382773[source]
Image sensors don't "output images in a lossy format" as far as I know.