Lossless JPEG detected as Lossy
Using the latest version of the Mac version of MediaInfo from the app store.
You can see the results in this Image
Lossless JPEGs use the following Start of Frame (SOF) markers: SOF3, SOF7, SOF11, SOF15 aka 0xFFC3, 0xFFC7, 0xFFCB, 0xFFCF, respectively.
the sof marker number is the only way to truly tell if an image is lossy or lossless.
the image that was misdetected as lossy can be found here
This one uses SOF3. And it is recognized, just not propagated: https://github.com/MediaArea/MediaInfoLib/blob/2f3998512ec3cc6f55c0905eb993bfce95a9a3b2/Source/MediaInfo/Image/File_Jpeg.cpp#L643
SOF3, SOF7, SOF11, SOF15
Last time I checked it should not be zeroes, but Os (Start of). Sigh. https://www.itu.int/rec/T-REC-T.81 and https://www.w3.org/Graphics/JPEG/itu-t81.pdf
SOF3 is Lossless (sequential), Huffman coding
SOF11: Lossless (sequential), arithmetic coding
SOF7: differential lossless process frame marker, Huffman coding
SOF15: differential lossless process frame marker, arithmetic coding
Thanks, I fix that when I have some free time.
I can give a pull. 0 --> O in two files and add those new markers. Wait a second.
I can give a pull
go :)
BTW, the image is reported as not conformant by reference implementation. Here is my compile with VS 2022. https://github.com/thorfdbg/libjpeg/issues/61#issuecomment-1034869582
reading a JPEG file failed - error -1038 - invalid stream, found invalid huffman code in entropy coded segment