JAR – JPEG Auto Repair: Every menu and button

Every control in JAR, in the order it appears on screen, with what it does and why it may be greyed out. For how to repair a photo step by step, see the main help page and the videos; this page is the reference to look things up in.

JAR menus and buttons

Main window: the top row

  • Open… Choose the damaged JPEG, or a RAW photo (JAR then takes the JPEG out of it first). You can also drop a file onto the picture area or onto the program icon. Greyed out while JAR is busy, and when its helper programs are missing or from another version (JAR says so at startup).
  • File box. Shows the file that is open. JAR never changes that file; everything it saves is a new file next to it.
  • Analyse. Cleans a copy of the file, repairs the header if it can, and works out every damaged spot. The gaps it finds go into the gap list and are marked red on the picture. Greyed out until a file is open, and while JAR is busy.
  • Repair. Saves the repair next to the original as name_auto.jpg (the trial saves a scaled-down copy). Greyed out until Analyse has run, when Analyse found nothing to repair, and when the plan holds colour jumps that can’t be stored (the status line then says so; fix those gaps in assisted mode).
  • Smooth scars. After a repair: fills the seams the repair left with texture from around them and saves name_auto_smooth.jpg; your repair stays as it is. Available in Home and Pro after Repair. In the trial it explains that smoothing is in the registered versions. Greyed out before a repair, after a stuck bit warning (that damage runs through the whole photo), and when its helper program is missing.
  • Cancel. Stops what JAR is doing (Analyse, Repair, smoothing, a check). Only active while JAR is busy. Nothing half-done is saved.

Options

  • Fill inserted blocks from the row above. Where JAR inserts MCUs for data that is missing, they get the picture content of the row above them. Off: they stay grey, which shows exactly where data was lost. On by default. Changing it takes effect at the next Repair; no new Analyse needed.
  • Crop missing tail (instead of filling). When the data ends before the bottom of the picture, JAR makes the picture shorter. Off: the missing part is filled from the row above. On by default. Changing it takes effect at the next Analyse.

Both are greyed out while JAR is busy. Batch mode uses them too.

The gap list

One line per damaged spot, top to bottom. Click a line to see it marked on the picture and to edit it in assisted mode.

Column What it means
# Number of the line.
row, col The MCU where the fix starts: row from the top, column from the left (0 = first).
del MCUs removed there: blocks the decoder made from damaged or foreign data.
ins MCUs added there, for data that was lost (or filled, on a fill line).
Y, Cb, Cr Brightness, blue and red correction for everything after this spot. 0 = no change.
cost How well the edges fit after the fix. Lower is better; a value well above the lines around it is a spot worth checking.
seam The shift the picture itself pointed to, with its strength in brackets. – = no clear seam.

Some lines say something else in the seam column:

  • rejected: there was a seam, but it was ambiguous and a fit without it was clearly better.
  • merged: two damaged spots close together, repaired as one.
  • tail fill: the data ran out here; the rest of the picture is filled from the row above.
  • padding fill: the empty end after removed blocks, filled from the row above.
  • safety fill: blocks JAR filled from the row above because their colour couldn’t be stored any other way.
  • fill: a damaged restart interval, filled from the row above.
  • align start: the start of the data was lost (a header from a reference file); the picture is shifted into place and its colour estimated.
  • (from below): the fill comes from the row below (only in the first row, which has nothing above it).
  • … N more: the list shows at most 2000 lines.

Only gap, tail and align-start lines can be edited. Fill lines are worked out again after every change.

Assisted mode: selected gap

The panel shows the gap you clicked in the list, so you can correct it by hand. It is greyed out before Analyse, when there are no gaps to edit, and for photos with restart markers (assisted mode doesn’t support those yet).

  • Row / Col. Where the fix starts. JAR places it itself, at the first damaged MCU, and you rarely need to change it: only when the damage clearly starts somewhere else than the red mark.
  • Delete (- / +). How many MCUs are removed at that spot. These are blocks made from damaged or foreign data. More: everything after the gap moves left (a whole row more: up one row).
  • Insert (- / +). How many MCUs are added at that spot, for data that was lost. They are filled from the row above (or grey, with Fill inserted blocks off). More: everything after the gap moves right (a whole row more: down one row). For the align-start line, Insert shifts the whole picture.
  • = del. Sets Insert equal to Delete (no sideways shift) and estimates the colour correction for that. Nothing changes until you click Apply. Only available for an ordinary gap, not for the tail or an aligned start.
  • Y, Cb, Cr sliders. Brightness, blue-yellow and red-green of everything after the gap. Slide until the part below matches the part above. The box next to each slider takes a typed value.
  • 0. Sets that slider back to no change.
  • Apply. Rebuilds the preview with your values. The gaps further down keep their own fixes and move along with your change.
  • Reset gap. Back to what JAR chose for this gap.
  • Re-plan below. Keeps your change and lets JAR search every gap after it again. Use it when your change moved things so far that the fixes further down no longer fit.
  • Zoom on gap. Shows the rows around the gap at full size, with a red line at the spot.

Repair saves what the preview shows.

Main window: the bottom row

  • Reference header… Choose an intact photo from the same camera; JAR uses its header instead of the damaged one. JAR asks for one by itself when it can’t repair the header, or when the start of the file is encrypted (ransomware). While a reference is in use, the same button asks whether to stop using it. Greyed out until a file is open, and while JAR is busy.
  • Header line. Where the header comes from: from the file itself, or from the reference file. With scan data at a number, the picture data starts at that byte of the damaged file (given by you, or after an encrypted start).
  • Original. Shows the damaged file. After Analyse it shows JAR’s cleaned copy, with each gap marked red.
  • Repaired. Shows the repair, or the preview of your changes in assisted mode. Greyed out until there is one.
  • Smoothed. Shows the smoothed repair. Greyed out until Smooth scars has saved one.
  • Picture area. Yellow ticks along the top and left edge are a ruler; the legend says how many MCUs one tick is and how large the grid is. Drop a file here to open it.
  • Status line. What JAR did and found: the header, the clean-up, the gaps, warnings (a stuck bit, USB command sectors from a faulty card reader, a size that looks wrong) and where the result was saved. Read it after every Analyse.
  • Progress bar. How far the current step is.

Tools menu

  • Search for gaps anyway. Analyses again and looks for gaps even though the image data decoded without errors. Use it only when you still see a shifted or discoloured band; on a good photo it can add damage. Available only right after an Analyse that found no errors and no gaps.
  • Contrast of the original… For a header from a reference file: how much coarser the damaged photo’s quality was than the reference’s (for example 2.5). Too flat: higher; too harsh: lower; empty = JAR estimates it. Analyse runs again. Greyed out without a reference header, because it changes the reference’s tables.
  • Check the width… Works out from the image data which width the picture really has, without a reference. If another width fits clearly better than the one in the header, JAR offers it and analyses again at that size. Open the file again to go back. Available after Analyse, not after a stuck bit warning.
  • Batch repair folder… Repairs every JPEG in a folder in one run (see below). Pro license.
  • Extract JPEG from RAW photos… Saves the embedded JPEG of every RAW photo in a folder (see below). Pro license. One RAW at a time works with every license, through Open.
  • Byte map, entropy, histogram… Opens the diagnostics window for the open file (see below). Greyed out while JAR is busy.
  • Tools > Structure (markers)… “Shows how the file is built in a JPEGsnoop like manner: a short summary (size, camera, quality, restart markers, thumbnail), problems in red, and one line per part of the file. Select a line for its details; Show the bytes (hex) adds the raw bytes. Copy as text puts it all on the clipboard, handy for support. Read-only: it never changes the file.”
  • Forensic mode (Pro)… a report with every repair, for evidence work. While it’s on, each saved repair gets <name>_report.html next to it, with the hashes of the original before and after the repair, every byte removed and every change made (with positions), the photo in grey with the filled blocks in red, and a check that every kept block is identical to the original. The contrast isn’t changed, smoothing is off, and no metadata is taken from a reference header. It’s the same setting as the box in the batch window; see Forensic mode in the help for how to check a report yourself.

Help menu

  • How to use JAR (web page). Opens the help page on disktuna.com.
  • Register… Enter your license key. Keys for JPEG-Repair work too. Greyed out while JAR is busy.
  • Help > Check for a newer version…: “Asks disktuna.com which build is the latest and compares it with yours. Only when you click it; nothing about you, your license or your photos is sent.”
  • About… Version, license and the notices for the open-source parts JAR uses.

The title bar shows the build number and which license is active: Trial, Home or Pro.

Batch repair and Extract JPEG windows (Pro license)

Both windows work the same way; Extract has no reference header and no smoothing.

  • Folder with damaged JPEGs / RAW photos: Folder… Choose the folder. The line below it says how many files it holds and where the results go.
  • Reference header (optional): Choose… An intact photo from the same camera, used for every photo whose header JAR can’t repair by itself (and for photos with an encrypted start). Without one, those photos are skipped. Once chosen, the button reads None: click it to stop using that reference.
  • Also smooth the scars of each repair. Saves a smoothed copy, name_smooth.jpg, next to each repair. Off by default: look at the smoothed copies before you use them. Batch repair only.
  • Start. Runs through the folder, one file after the other, without questions. Repairs go to the subfolder JAR_repaired (extracted JPEGs to JAR_extracted), with a tab-separated log. Greyed out until a folder with files is chosen, and during a run. With a reference header and photos with an encrypted start, JAR first estimates the contrast from a sample of them.
  • Stop. Ends the run; the file it was working on is not saved. Only active during a run.
  • Open output. Opens the output folder. Available after a run.
  • Close. Closes the window. Greyed out during a run.

Without a Pro license the menu items say (Pro license) and are greyed out. After a batch run, click Analyse again in the main window for the photo that was open there.

Diagnostics window

Shows what is in the file itself, before any repair: whether there is image data at all, and where the damage is.

  • Byte map (left). Each pixel stands for a few bytes, read top to bottom. Healthy JPEG data is even, fine noise; black is zeros or low values. Move the mouse over it to see the offset; click to copy the offset (for a hex editor). The scroll bar moves through a large file.
  • bytes/pixel. How many bytes one pixel of the map stands for. Smaller: more detail; larger: more of the file at once.
  • JPEG markers. Colours the markers in the map: blue = FF 00 (normal in JPEG data), green = restart markers, red = any other FF xx (damage, which the clean-up removes). The legend under the map repeats this.
  • Entropy per block. How random the data is, 0 to 8 bits per byte. Image data stays close to 8; a dip means something else sits there. The blue line marks where the image data starts.
  • Byte histogram. How often each byte value occurs in the image data (or in the whole file when there is none). Nearly flat is healthy; tall spikes mean data that isn’t JPEG.
  • Bit balance. One bar per bit, and the same check across the file. All close to the centre line is healthy; a red bar past the dashed lines points at a stuck bit (faulty reader or adapter). Its title says OK or which bit looks stuck (in odd bytes or in even bytes when it fails in every other byte only: then the reader or adapter is the likely cause), or that there is too little image data to tell.
  • Line at the bottom. The exact values under the mouse, in any of the panels.

The window title names the file. It works on the file as it is on disk, so it also opens files JAR can’t analyse.

Structure window

Tools > Structure (markers)… shows how the file is built, part by part, before any repair: whether the header is intact, what it says, and where it stops making sense. Read-only: it never changes the file.

  • Summary (top). The picture in plain words:
    • picture type, size and colour layout (4:2:0, 4:2:2 …), and the block (MCU) size;
    • camera and date (from Exif), and an estimated quality;
    • standard or own Huffman tables, and restart markers;
    • the thumbnail, where the image data starts, and any bytes after the end.
  • Problems (red line). What doesn’t add up:
    • a length that doesn’t fit;
    • data in front of the JPEG start;
    • the byte where the header stops making sense;
    • a missing end marker (cut off).

    “None found in the structure” means the header is fine; the image data can still be damaged.

  • Parts list. One line per part of the file, in order: offset, marker (FF xx), name, length in bytes, and what it holds. Data before the start or after the end gets its own line. A “!” at the end of a line repeats that part’s problem.
  • Details (bottom). Everything the selected part says:
    • quantization tables as 8 × 8 grids;
    • Huffman tables, and whether each is a standard one;
    • colour components and sampling;
    • Exif fields.

    For the image data: restart markers, markers that don’t belong there, stray sectors, and sectors of zeros.

  • Show the bytes (hex). Adds the first 1 KB of the selected part to the details, in hex and as text.
  • Copy as text. Puts the summary, the parts and their details on the clipboard, handy for support.
  • Close. Closes the window (Esc does too).

The window title names the file. Like the diagnostics window, it works on the file as it is on disk, so it also opens files JAR can’t analyse.