JPEG checksum data (not the whole file)

Are there end-of-exif / end-of-xmp / end-of-iptc / start-of-data markers that I could use to get the checksum of only a portion of the jpg / jpeg data (and other image formats)?

+4
source share
6 answers

MediaTags has checksum support for JPEG, MP3, M4A, etc.

0
source

I think this question is related to this. Calculate the hash of only the main image data (excluding metadata) for the image , fooobar.com/questions/346854 / ... gives an answer element if you are looking for code.

It may not work with all JPG options: some of them can embed multiple images (MPF / CIPA multi-format image format, more information at http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/MPF .html ) and you may have some metadata. In addition, some software places the UID in the form - [0-9A-F] + - at the end of the file and should not be read. A safe solution if probably checksum pixels (although you can still have the effect of orientation, color profile, ..).

+1
source

One easy way to get the hash sum of just the given pixels would be to convert JPEG to 32-bit BMP or, alternatively, to PNG and calculate the hash from that. This will remove all related information from the JPEG files and even correspond to JPEG files with different encodings that result in the same pixel data. Of course, you can also use the data in pixels of memory from the BMP received directly if you have one (i.e. Windows has several API functions to get it from any supported image type).

0
source

You will need to look at each format. For JPEG, it looks like a structure implies that you can simply execute a checksum of sections that start with FFEn (e.g. 0xFFE1) and a checksum bytes specified after each marker (it seems the length follows the marker and is 2 bytes in capital letter format ) See here for more details.

0
source

Yes for jpeg and exif, I do not know others.

The JPEG spectrum that I have is called JFIF (JPEG file exchange format), it comes from Appendix B of the ISO 10918-1 standard and, like all ISO specifications, carefully studies how to convert the specification to data structures. I think it is much easier to follow.

EXIF format is very similar to TIFF format. each piece has a type and size, so you just walk through the pieces until you reach the piece of image data. it has a pointer to image data (it actually points to stripes, but I'm sure you can read everything after the first strip of image data at the end of the file is image data.

Exif format has its own website

0
source

Since you want to do this for different image formats, you should just use the general decompression library and run the checksum for uncompressed data. This will allow you to match the same images, even if they are encoded differently on disk.

If you want to limit yourself to JPEG, you can check the data between SOI and EOI. This answer can be slightly adapted in order to do what you need.

0
source

All Articles