Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is JPEG marker 0xb9?

Tags:

jpeg

I'm a JPEG novice, and I'm trying to decode a (possibly corrupted) JPEG (or rather, JFIF) file.

My image viewer program complains about an illegal 0xb9 marker.

The file does not have an SOF (Start Of Frame) marker, instead it has this APP1 segment

ff e1 00 0b 50 49 43 00 02 28 3c 01 00

followed by this segment with a 0xb9 marker:

ff b9 00 11 08 06 4c 04 d3 03 01 22 00 02 11 01 03 11 01

What am I looking at here?

EDIT

I have been asked about where the file came from. Here's the story:

About 20 years ago I bought a collection of magazines on CD-ROMs. The magazines can, however, only be read on old Windows computers, so I'm trying to find another way to read them - preferably one that works on my Linux computer. As far as I can tell, the magazine pages are stored as a lot of JFIF files that are simply concatenated together.

So to start with, I've extracted one of the JFIF files, and now I'm trying to find a way to view it.

EDIT 2

I've been asked to share a picture file. I'm not sure if I'm committing a copyright violation by doing so, so I'll remove the file again after a couple of days. Anyway, one of the problematic picture files may be downloaded from here:

https://www.dropbox.com/s/9da72gdri8c9xwp/f1000.jpg

I have no idea what the file contains except that it is probably a page from MAD Magazine.

The ff b9 segment looks very much like a SOF0 segement, and changing it to ff c0 (SOF0) makes the picture visible, but only as a collection of random pixels.

The APP1 segment mentioned above contains the string PIC, which is not part of any APP1 segement type that I'm aware of.

EDIT 3

Since this question has now been answered, I will remove the file from Dropbox in order to avoid any copyright issues. Thank you to all who contributed to this.

like image 638
oz1cz Avatar asked May 07 '19 16:05

oz1cz


People also ask

What is JPEG marker?

The markers The header part of a JPEG file is divided into segments, and each segment starts with a marker, identifying the segment. Usually a JPEG file contains 7 different markers. A marker is a pair of bytes, the first is 255 and the second is different from 0 and 255. We identify a marker by its second byte.

What does invalid JPEG marker mean?

What's an unknown or invalid JPEG marker? Even though you can see the correct preview and thumbnail of a certain JPEG, often the image will not be able to open in Photoshop so that it can be edited. This is a very common kind of error that is caused due to improper image format, error while renaming, corrupt file, etc.

Can't open JPEG marker is missing?

Solution 1: Open the image in MsPaint! then save it back over the original file or save as a new jpeg/png/bitmap/tiff file. Open the new image in photoshop. Solution 2: If you have large number of images then the first solution will be time consuming.


1 Answers

According to ITU T.86 Amendment 1, the APP1 segment with identifier "PIC" contains "Accusoft Pegasus custom fields." This suggests that the file may have been created using Accusoft tools, and that they might be able to decode it as well.

(Indeed, in your comment above you say that you managed to successfully open the file using the demo version of Accusoft's "Apollo" picture viewer.)

As for the FFB9 segment marker, I'm still not sure what it means. I did manage to find some code in the JPEG XT reference implementation (called "libjpeg"; not to be confused with the widely used library of the same name by the Independent JPEG Group) that appears to recognize it, and includes a comment saying that it denotes "residual scan, ac coded". Whatever that means, however, I'm not 100% sure about.

Apparently it has something to do with supporting images with more than 8 bits of dynamic range per pixel, with the "residual scan" storing additional high-precision pixel data which can be combined with the basic 8 bit JPEG image data to reconstruct the full HDR image. But if so, it seems strange to have a file with only such a residual scan marker without any normal SOI marker. Given that, according to jakub_d, the JPEG XT library cannot actually parse your file, it might be that it's using the marker in some nonstandard way.

like image 143
Ilmari Karonen Avatar answered Sep 21 '22 11:09

Ilmari Karonen