Jhead is a command line driven program for manipulating the non image parts of Exif flavour Jpeg files that most digital cameras produce.

Jhead has no Graphical User Interface. Clicking on it with the mouse from Windows won't do anything for you - you have to use it from the Command prompt (or Dos prompt under Win95/98)

Jhead program Features

Command line options

-dt Delete thumbnails. Exif headers have a built-in thumbnail, which typically occupies around 10k of space. As far as I can tell, this thumbnail is only used by the digital cameras to display several really small thumbnails at a time. The thumbnails are too small to use even full screen on the digicam's LCD. I have not encountered any adverse side effects of deleting the thumbnails, even from the software provided with the digicams.

This command line option simply shortens the exif segment of the jpeg file so that the interesting settings are still in the camera.

-h Displays summary of command line options.
-v Makes the program even more verbose than it already is. Like dos programs, and unlike Unix programs, Jhead gives feedback as to what it is doing, even when nothing goes wrong. Windows user that I am, when something doesn't give me feedback for 20 seconds, I assume its crashed.
-c Concise output. This causes picture info to be summarized on one line instead of several. Useful for grep-ing through images, as well as importing into spread sheets (data is space delimited with quotes as text qualifier).
-model Restricts processing of files to those whose camera model, as indicated by the exif image information, contains the substring specified in the argument after '-model'. For example, the following command will list only images that are from an S100 camera:

jhead -model S100 *.jpg

I use this option to restrict my JPEG re-compressing to those images that came from my digicam, see the -cmd option.

-n This option causes files with dates stored in the exif header to be renamed to the file date. Renaming is restricted to files whose names consist largely of digits. This effectively restricts renaming to files that have not already been manually renamed. Use the -nf option to force renaming.

The file will be renamed to MMDD-HHMMSS. The year is not used for the file name (if you have images from that many different years together, you probably don't care enough about organizing your images to use this program. If you don't like it, you can always change the program.

If the destination name is already in use (if another photo was taken at the exact same time by another camera), the times for next subsequent seconds are tried.

This option is useful for naming jpegs of the same event taken from two cameras in such a way that they will appear in order in file managers and programs like Compupic or ACDSee.

-nf Same as '-n' but renames files regardless of original file name.

-cmd Executes the specified command on each Jepg file to be processed.

The Exif section of each file is read before running the command, and re-inserted after the command finishes.

The specified command invoked separately for each Jpeg that is processed, even if multiple files are specified (explicitly or by wild card). I use this option to process whole directory trees of Jpegs from my digital camera with JPEGTRAN (Independent Jpeg group) and Image-Magic's 'MOGRIFY' command without loosing the camera settings and other info stored in the Exif headers.

JPEGTRAN is useful for lossless rotation, as well as for converting Jpegs to progressive Jpegs (also a lossless process, but results in typically 5% smaller files) I use mogrify for re-compressing the images I get from my Canon PowerShot S100 to 80% quality. The cannon Jpegs are either way too 'high quality' for the resolution, or are suboptimally encoded. Using mogrify to 80% produces no detectable loss in quality, with files about half the size.

Example use:
Having a whole directory tree of photos from my S100, I run the following commands:

    jhead -cmd "mogrify -quality 80 &i" -model S100 -r *.jpg
    jhead -cmd "jpegtran -progressive &i &o" -r *.jpg

The first command mogrifies all jpegs in the tree that indicate that they are from a Cannon S100 in their exif header to 80% quality at the same resolution. This is a 'lossy' process, so I only run it on files that are from the Canon, and only run it once. The next command then takes all jpegs and converts them to progressive Jpegs. The result is the same images, with no discernible differences, stored in half the space.

Keeping the Exif header information is important to me, as I like to check things like the shutter speed for some of my photos, and my HTML index generting program uses the exif tags to display the Jpeg images in order of taking.

-r The recursive feature of version 1.0 never worked to my satisfaction, and I replaced it with my recursive file globbing code in the Windows version. See below.

Name globbing and recursive directories

Programs I use with Jhead

ImageMagic
    I use the MOGIRIFY command from image magic to do batch conversions and re-compresses of images. If you use Linux, you probably already have ImageMagic on your system (just type 'mogrify' at the command prompt to see if you have it). For Windows users, you have to download it from: http://www.imagemagick.org

JPEGTRAN
    If you use Linux you probably also already have this program. For windows, its hard to find a pre-built binary on the web. The Independent Jpeg Group's website only has the source code.

    There's a fancier version, with pre-built Windows binaries and a lossless cropping feature added at: http://sylvana.net/jpegcrop. I have a Compiled Windows Binary of Jpegtran on my website. I got this one by taking the source code for Jpegtran out of the RedHat 6.1 Linux distribution, and compiling it with Microsoft Visual C 5.0.

CompuPic
    I also use CompuPic to organize my photos. This unfortunately is payware, but its a pretty good program. It has a free two week evaluation period. After this period, it is still semi-usable but annoying. I ended up paying for it. I don't know of a good free program for Windows to do the same thing.