Return to Digital Photography Articles
JPEGsnoop - Options
This page details some of the main options you'll find in JPEGsnoop
JPEGsnoop is very easy to use... quite simply:
Steps to Process a File
- Select the decoding options under Options->
- Open your JPEG file with File->Open...
- Save the output with File->Save Log... if desired
Alternately, you can drag-and-drop a JPEG file onto the JPEGsnoop icon or main window and have the report automatically generated. Opening a JPEG file will automatically start the decoding process and generation of the log file.
There are several options you can enable in decoding the JPEG file. These display additional information about the JPEG file. If the Auto Reprocess option in the Configuration window is disabled, then any changes to the Options below will not be reflected in the log until either a new file is opened, or you manually File->Reprocess.
- Hide unknown EXIF tags - This option will turn off decoding of EXIF tags that are not currently known in JPEGsnoop's database.
- DHT Expand - Expands the JFIF Huffman code table into the actual list of variable-length binary strings that are searched during the decoding process. This is a much more human-readable form of the huffman code list.
- Scan Segment - Decode Image - This option turns on the real decoding of the Scan data segment. In doing so, several checks are performed to ensure that all the variable length codes are valid and that there is no data corruption. It also performs the color conversion step from YCC to RGB and reports any color channel clipping.
- Scan Segment - Histogram RGB - If Decode Image is enabled, the Histogram RGB option will show a histogram for the RGB components, in addition to the reporting of any YCC/RGB clipping. Note that this option slows down the color conversion process (and is off by default).
- Scan Segment - Histogram Y - If Decode Image and Histogram RGB options are enabled, the Histogram Y option will show a histogram depicting the luminance (Y) DC component of the image. In addition, a full 2048-bin histogram dump is written to the log file. This dump shows the number of MCUs (8x8 pixel blocks) that exist in the (DC) image for each intensity level (-1024 to +1023). Counts are written in hexadecimal notation.
- Scan Segment - Full IDCT - When this option is enabled, the scan decode process does a full IDCT (Inverse Discrete Cosine Transform) to generate the high-resolution image view. Both the DC and AC coefficients of each MCU is computed. This mode is computation-intensive and can be slow.
- Scan Segment - No IDCT - When this option is enabled, the scan decode process does not do IDCT, and can produces a low-resolution image view. Only the DC coefficients of each MCU is computed. This mode is much faster than the IDCT mode but the result is low-res and less accurate. Default mode of operation.
- Scan Segment - Scan Dump - Enabling this option dumps out the first 640 bytes of scan data (in the Start of Scan (SOS) segment) in hexadecimal, after byte stuffing has been handled.
- Scan Segment - Detailed Decode... - Use this option to dump out detailed info about the Huffman VLC (variable-length codes) that make up the Scan bitstream. This is extremely useful for those who are trying to understand JPEG compression at a low level or build their own encoder/decoder. A dialog box will ask you for a starting MCU coordinates and MCU length. Prior to entering the dialog box, you can mouse-over or click in the area of the image that you want to start decode, and take note of the MCU X & Y coords. Enter these values into the dialog and then hit Reprocess or Open a new file to see the results. The detailed decode is included in the Start of Scan segment in the log.
Note: The DC component shown in each DCT matrix is the DC contribution from the current block -- it does not represent the running DC total (ie. the inverse DPCM step).
- Maker Notes - Decode the Maker Note section (manufacturer-specific data) if it is a make supported by JPEGsnoop. As some cameras store a lot of unknown data in this section, you may want to disable it to avoid clutter.
- Configuration - Opens a window where you can set a number of additional options. Please see the Configuration Window section below.
- Check for Updates - This will manually check the ImpulseAdventure.com website for newer releases of JPEGsnoop.
Note that the image and histograms are only displayed if Decode Scan Image is enabled.
- Image Search Fwd - Searches in the most recently opened file from the current file position forwards, looking for the next potential embedded JPEG image. This command is searching for the SOI (Start of Image 0xFFD8) marker, and may encounter the occasional false positive.
- Image Search Rev - Same as SOI Search Fwd, but in the reverse direction.
- Lookup MCU Offset... - Enter a pixel coordinate, press Recalc and determine the file offset to the start of the MCU! This is extremely useful for locating sections of a corrupt JPEG. Note that offsets are provided in the format: 0x<byte position in hex> : <bit position> . In other words 0x0000C832:4 means that the MCU starts at file position 0xC832 (or 51250) bytes, at the 4th bit (from the most significant bit). The MCU positioning is also displayed automatically in the lower image window's status bar when the mouse moves across the image window.
- File Overlay... - NOTE: This function will be described in greater detail in a later release, but it can be used a number of different ways, including the ability to fix corrupt JPEG files. Enter a file position offset, click Load Original (to see the current value) and then have the ability to overwrite these values with new hex values (no spaces between bytes). Click on the Enabled checkbox to have this overlay used for further decodes, or uncheck it to disable it. Specify the number of bytes to overwrite (up to 8).
- Search Executable for DQT - Allows advanced users to identify compression quality tables within an executable or library. For more imformation, please see the section in the Interesting Uses page.
- Export JPEG - Attempts to export the JPEG image that has been decoded at the current file offset (e.g. after Image Search or File Offset). This can be used to extract JPEG thumbnail images, extract AVI MJPEG frames, etc. The user will be presented with a dialog that asks whether or not the default MJPEG DHT tables should be inserted (for AVI frame export) and whether or not any user-defined file overlays will be used to generate the output.
- Add Camera / SW to DB... - Add the compression signature of the image to the database! This shared database is used to determine what digital camera (or photo software) was used to create the image. The database is growing and will be constantly updated by other JPEGsnoop users. Please only add a camera compression signature to the database if you are reasonably sure that the image is direct from the camera (i.e. not processed or edited in any way) or processed from a known software program. When submitting the compression signature, absolutely no image content or EXIF data is recorded -- only the compression statistics and quality setting.
- Manage Local DB If you want to clear out the user database (for example, if you have added incorrectly-described signatures), or simply remove a single entry, this option will bring up a dialog box that lets you delete one or more entries.
Note that you can hold down the control-key shortcuts (Ctrl-2 or Ctrl-1), which will step through a file at high speed. For MotionJPEG AVI files, this will play the video while decoding the tables and histogram!
- Image Chan - Select the channel to display in the image area. You can select full-color RGB or YCC in addition to the individual sub-channels: R/G/B or Y/Cb/Cr.
- Image Zoom - Selects the zoom level in displaying the DC component image. At 12.5%, each 8x8 pixel block is represented by a single pixel. At 800%, each image pixel is represented by an 8x8 pixel region.
- Overlays - MCU Grid - Toggles the display of the MCU grid. The grid marks the MCU boundaries in the image, according to the current chroma subsampling levels. Pressing Ctrl-G will toggle the display of the grid. Note that the grid is automatically hidden when the zoom level is less than 100%.
- Offset... - Allows you to specify a starting offset for the JPEG decoding process. In the dialog, the default is for entry in hexadecimal notation, but you can click on the decimal radio button to convert.
- Reprocess - Reloads the last file and reprocesses the image with the current set of configured options. Note that this is not necessary if the Auto Reprocess option under Configuration is enabled.
- Print - Standard printing support for the main report window.
Command Line Invocation
As requested by some users, command-line execution is supported. You can enable most options from the command line and generate the unlimited output file automatically. Example:
JPEGsnoop.exe -i c:\temp\20050203_1234.jpg -o c:\temp\20050203_1234_snoop.txt -nogui
The above will open up the JPEG file located at c:\temp\20050203_1234.jpg, write out to the log file c:\temp\20050203_1234_snoop.txt and do this without bringing up the GUI (application window).
Other options include:
- -help - Display command-line help
- -i fname - Opens JPEG file named fname for processing
- -b dir - Batch process directory dir
- -br dir - Batch process directory dir recursively
- -o fname - Opens text file named fname for the generated output log file
- -ext_all - Extract all from file
- -ext_dht_avi - Force insert DHT for AVI (-ext_all mode)
- -scan - Enables Scan Parse mode
- -maker - Enables Makernote decode
- -scandump - Enables Scan Dump mode
- -histo_y - Enables Luminance Histogram Dump mode
- -dhtexp - Enables DHT Expand mode
- -exif_hide_unk - Disables decoding of unknown makernotes
- -offset_start - Decode at start of file
- -offset_srch1 - Decode at 1st SOI found in file
- -offset_srch2 - Decode at 1st SOI found after start of file
- -nogui - Performs the command-line actions without leaving open the application window. If you don't specify this option, the command line options are still performed, but the application window will be left open.
- -offset_pos pos - Starts decoding at byte offset pos (in decimal)
- -done - Indicate when operations done