News for hackers. Stuff that matters.
Re:PSD is not my favourite file format (2009) by stagger87 on Thursday January 28, 2021 @02:34PM (#25947716)
I'd love to hear why they think JPEG is a worse format.
Re:PSD is not my favourite file format (2009) by user-the-name on Thursday January 28, 2021 @02:38PM (#25947798)
Not worse, that is the point. It is merely a bad format, which is better than what PSD is.

As for why JPEG is bad: Did you know there is no one defined way to store the width and height of a JPEG image?

Re:PSD is not my favourite file format (2009) by userbinator on Thursday January 28, 2021 @03:48PM (#25948966)
As someone who has written a JPEG decoder, I am compelled to say that you are wrong, and the width and height are stored in the SOF marker segment.

http://vip.sugovica.hu/Sardi/kepnezo/JPEG%20File%20Layout%20...

Re:PSD is not my favourite file format (2009) by user-the-name on Friday January 29, 2021 @07:02AM (#25956400)
I might be misremembering, but at least, SOF does not tell you what is actually in the channels of the image, so it is not enough to figure out how to actually display an image.
Re:PSD is not my favourite file format (2009) by just_for_you on Thursday January 28, 2021 @04:00PM (#25949124)
To my knowledge, I see most JPEG images encode their height in an "APP1" EXIF segment, and in their SOF1 segment (which is basically just a basic-info segment for the core JPEG bitstream). It's also possible to store the size in an APP1 XMP section, but that's mostly non-essential metadata for interchange purposes, and I usually don't see the size duplicated there for JPEGs anyway (PNG does though, if it has an XMP chunk).

It's possible that some of the other officially-defined segments (see https://exiftool.org/TagNames/JPEG.html) might also contain duplicate info, but then that'd be specific to the app that uses it, not for general-purpose use.

Storing the size in easily-parseable EXIF metadata and then once again in the JPEG bitstream seems pretty reasonable to me. Not to mention if you run a metadata/EXIF stripper on a JPEG file, then you remove all duplicate info and the only remaining image-dimensions will be stored in the JPEG bitstream anyway.

Re:PSD is not my favourite file format (2009) by stagger87 on Thursday January 28, 2021 @02:46PM (#25947905)
Thank you, I totally misread that!
Re:PSD is not my favourite file format (2009) by eyesee on Thursday January 28, 2021 @03:19PM (#25948433)
Well for one thing it's not a file format. For that there's JFIF and EXIF.
Re:PSD is not my favourite file format (2009) by stagger87 on Thursday January 28, 2021 @03:24PM (#25948528)
I actually thought about that when I typed my reply, but decided the meaning of my question would still be clear the way it was phrased. Despite that, my question is more or less irrelevant since I misunderstood the author.