jpegextractor—extract embedded JPEG streams from arbitrary files

because jpegextractor has some relation with PDF, so post it here.

Several file formats can include images as JPEG streams, e.g. PDF document files or ACDSee image database thumbnail files (image_db.dtf). In order to get to those JPEGs, it was necessary to either have a program that knows the file format and can extract the JPEGs from the right places, or to use a hex editor and copy binary data “manually”.

jpegextractor has yet another approach, it uses the fact that valid binary JPEG streams start with the byte sequence (given as values in hexadecimal notation) ff d8 ff and end with ff d9. It copies all of those streams to new files. As jpegextractor simply looks for the two sequences it does not have to know the format of the encapsulating file and thus works with all formats that embed JPEG streams.

Caveat: jpegextractor has problems with embedded thumbnails which are stored as JPEG streams within the JPEG stream.

Usage: java jpegextractor [FILEs]
Extract embedded JPEG streams from arbitrary files or standard input.

Options:
-H, –help Print this help screen and terminate.
-d, –digits NUM Pad numbers in output files to NUM digits.
-D, –outputdirectory DIR Write to directory DIR (default: “.”).
-p, –prefix P Use P as output prefix (default: “output”).
-s, –suffix S Use S as output suffix (default: “.jpg”).
-n, –initialnumber NUM Use NUM as initial output number (default: 0).
-o, –overwrite Overwrite existing output files.
-q, –quiet Nothing is written to standard output.

Download source code and bytecode as a single ZIP archive: jpegextractor.zip (8 KB).

for more info, please visit
http://www.geocities.com/marcoschmidt.geo/jpeg-extractor.html

Leave a Reply