{
    "mode": "man",
    "parameter": "jhead",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/jhead/1/json",
    "generated": "2026-05-30T06:05:42Z",
    "synopsis": "jhead [ options ] [ file...  ]",
    "sections": {
        "NAME": {
            "content": "jhead - Digicam JPEG Exif header manipulation tool\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "jhead [ options ] [ file...  ]\n\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "jhead is used to display and manipulate data contained in the Exif header of JPEG images from\ndigital cameras.  By default, jhead displays the more useful camera settings from the file in\na user-friendly format.\n\njhead  can  also  be  used  to manipulate some aspects of the image relating to JPEG and Exif\nheaders, such as changing the internal timestamps, removing the  thumbnail,  or  transferring\nExif  headers back into edited images after graphical editors deleted the Exif header.  jhead\ncan also be used to launch other programs, similar in style to the  UNIX  find  command,  but\nmuch simpler.\n\n\n",
            "subsections": []
        },
        "GENERAL METADATA OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-te",
                    "content": "Transplant  Exif  header from a JPEG (with Exif header) in file into the image that is\nmanipulated.  This option is useful if you like to edit the photos but still want  the\nExif  header  on  your  photos.  As most photo editing programs will wipe out the Exif\nheader, this option can be used to re-copy them back from original copies after  edit‐\ning the photos.\n\n\nThis  feature  has  an interesting 'relative path' option for specifying the thumbnail\nname.  Whenever the <name> contains the characters '&i', will substitute the  original\nfilename  for  this  name.  This  allows creating a jhead 'relative name' when doing a\nwhole batch  of files. For example, the incantation:\n\njhead -te originals/&i *.jpg\n\nwould transfer the exif header for each .jpg file in the originals  directory  by  the\nsame  name,  Both Win32 and most Unix shells treat the '&' character in a special way,\nso you have to put quotes around that command line option  for  the  '&'  to  even  be\npassed to the program.\n\n"
                },
                {
                    "name": "-dc",
                    "content": "Exif header.\n"
                },
                {
                    "name": "-de",
                    "content": ""
                },
                {
                    "name": "-di",
                    "content": ""
                },
                {
                    "name": "-dx",
                    "content": ""
                },
                {
                    "name": "-du",
                    "content": "to the image either - such as data that photoshop might leave in the image.\n"
                },
                {
                    "name": "-purejpg",
                    "content": "Delete  all  JPEG  sections that aren't necessary for rendering the image.  Strips any\nmetadata that various applications may have left in the image.  A combination  of  the\n-de -dc and -du options.\n"
                },
                {
                    "name": "-mkexif",
                    "content": "Creates  minimal  exif  header.  Exif  header  contains date/time, and empty thumbnail\nfields only. Date/time set to file time by default. Use with -rgt option if  you  want\nthe exif header to contain a thumbnail. Note that exif header creation is very limited\nat this time, and no other fields can be added to the exif header this way.\n"
                },
                {
                    "name": "-ce",
                    "content": "structure and can be part of Exif and non Exif style JPEG images).\n\nA  temporary  file  containing the comment is created and a text editor is launched to\nedit the file.  The editor is specified in the EDITOR environment variable.   If  none\nis  specified  notepad  or vi are used under Windows and Unix respectively.  After the\neditor exits, the data is transferred back into the  image,  and  the  temporary  file\ndeleted.\n"
                },
                {
                    "name": "-cs",
                    "content": "Save comment section to a file\n"
                },
                {
                    "name": "-ci",
                    "content": "Replace comment with text from file\n"
                },
                {
                    "name": "-cl",
                    "content": "Replace comment with specified string from command line\n\n"
                }
            ]
        },
        "DATE / TIME MANIPULATION OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-ft",
                    "content": ""
                },
                {
                    "name": "-dsft",
                    "content": "Use -mkexif option to create one if needed.\n"
                },
                {
                    "name": "-n",
                    "content": "This option causes files to be renamed and/ or mmoved using the date information  from\nthe  Exif  header  \"DateTimeOriginal\"  field.  If the file is not an Exif file, or the\nDateTimeOriginal does not contain a valid value, the file date is used.   If  the  new\nname  contains  a  '/',  this  will be interpreted as a new path, and the file will be\nmoved accordingly.\n\nIf the formatstring is omitted, the file will be renamed to MMDD-HHMMSS.   Note  that\nthis  scheme  doesn't  include  the year (I never have photos from different years to‐\ngether anyway).\n\nIf a formatstring is provided, it will be passed to the strftime function as the for‐\nmat string.  In addition, if the format string contains '%f', this will substitute the\noriginal name of the file (minus extension).  '%i' will substitute a sequence  number.\nLeading  zeros  can  be  specified like with printf - i.e. '%04i' pads the number to 4\ndigits using leading zeros.\n\nIf the name includes '/', this is interpreted as a new path for the file.  If the  new\npath does not exist, the path will be created.\n\nIf  the target name already exists, the name will be appended with \"a\", \"b\", \"c\", etc,\nunless the name ends with a letter, in which case it will be appended with  \"0\",  \"1\",\n\"2\", etc.\n\nThis  feature  is  especially  useful if more than one digital camera was used to take\npictures of an event.  By renaming them to a scheme according to date, they will auto‐\nmatically  appear  in  order  of taking in most directory listings and image browsers.\nAlternatively, if your image browser supports listing by file time, you  can  use  the\n-ft option to set the file time to the time the photo was taken.\n\nSome of the more useful arguments for strftime are:\n\n%H Hour in 24-hour format (00 - 23)\n%j Day of year as decimal number (001 - 366)\n%m Month as decimal number (01 - 12)\n%M Minute as decimal number (00 - 59)\n%S Second as decimal number (00 - 59)\n%w Weekday as decimal number (0 - 6; Sunday is 0)\n%y Year without century, as decimal number (00 - 99)\n%Y Year with century, as decimal number\n\nExample:\n\njhead -n%Y%m%d-%H%M%S *.jpg\n\nThis will rename files matched by *.jpg in the format YYYYMMDD-HHMMSS\n\nFor  a  full  listing  of  strftime arguments, look up the strftime in them man pages.\nNote that some arguments to the strftime function (not listed  here)  produce  strings\nwith  characters  such as ':' that may not be valid as part of a filename on some sys‐\ntems.\n\n",
                    "flag": "-n"
                },
                {
                    "name": "-ta<+|-><timediff>",
                    "content": "Adjust time stored in the Exif header by h:mm forwards or backwards.  Useful when hav‐\ning  taken  pictures  with  the wrong time set on the camera, such as after travelling\nacross time zones, or when daylight savings time has changed.\n\nExamples:\n\nAdd 1 hourand 5 minutes to the time\njhead -ta+1:05\n\nDecrease time by one second:\njhead -ta-0:0:1\n\n\nThis option changes all Date/time fields in the exif header, including \"DateTimeOrigi‐\nnal\" (tag 0x9003) and \"DateTimeDigitized\" (tag 0x9004).\n"
                },
                {
                    "name": "-da<newdate>-<olddate>",
                    "content": "Works  like  -ta,  but for specifying large date offsets, to be used when fixing dates\nfrom cameras where the date was set incorrectly, such as having date and time reset by\nbattery removal on some cameras\n\nBecause  different  months  and years have different numbers of days in them, a simple\noffset for months, days, years would lead to unexpected results at  times.   The  time\noffset  is  thus specified as a difference between two dates, so that jhead can figure\nout exactly how many days the timestamp needs to be adjusted by, including leap  years\nand  daylight  savings time changes.  The dates are specified as yyyy:mm:dd.  For sub-\nday adjustments, a time of day can also be included, by specifying yyyy:nn:dd/hh:mm or\nyyyy:mm:dd/hh:mm:ss\n\nExamples:\n\nYear on camera was set to 2005 instead of 2004 for pictures taken in April\njhead -da2004:03:01-2005:03:01\n\nDefault camera date is 2002:01:01, and date was reset on 2005:05:29 at 11:21 am\njhead -da2005:05:29/11:21-2002:01:01\n"
                },
                {
                    "name": "-ts",
                    "content": "Time must be specified as: yyyy:mm:dd-hh:mm:ss\n"
                },
                {
                    "name": "-ds",
                    "content": "be  used  to  set  date,  just  year  and  month, or just year.  Date is specified as:\nyyyy:mm:dd, yyyy:mm, or yyyy\n\n"
                }
            ]
        },
        "THUMBNAIL MANIPULATION OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-dt",
                    "content": "option  truncates  the  thumbnail from the Exif header, provided that the thumbnail is\nthe last part of the Exif header (which so far as I know is always  the  case).   Exif\nheaders have a built-in thumbnail, which typically occupies around 10k of space.  This\nthumbnail is used by digital cameras.  Windows XP  may  also  use  this  thumbnail  if\npresent  (but  it  doesn't  need  it).   The thumbnails are too small to use even full\nscreen on the digicam's LCD.  I have not  encountered  any  adverse  side  effects  of\ndeleting  the thumbnails, even from the software provided with my old Olympus digicam.\nUse with caution.\n\n"
                },
                {
                    "name": "-st",
                    "content": "Save the integral thumbnail to file The thumbnail lives inside the Exif header, and is\na  very  low-res JPEG image.  Note that making any changes to a photo, except for with\nsome programs, generally wipes out the Exif header and with it the thumbnail.\n\nThe thumbnail is too low res to really use for very much.\n\nThis feature has an interesting 'relative path' option for  specifying  the  thumbnail\nname.  Whenever the name for file contains the characters  '&i', jhead will substitute\nthe original filename for this name.  This allows creating a 'relative name' when  do‐\ning a whole batch of files.  For example, the incantation:\n\njhead -st thumbnails/&i *.jpg\n\nwould  create  a  thumbnail for each .jpg file in the thumbnails directory by the same\nname, (provided that the thumbnails directory exists, of course).  Both Win32 and UNIX\nshells  treat the '&'character in a special way, so you have to put quotes around that\ncommand line option for the '&' to even be passed to the program.\n\nIf a '-' is specified for the output file, the thumbnail  is  sent  to  stdout.  (UNIX\nbuild only)\n\n"
                },
                {
                    "name": "-rt",
                    "content": "contains a thumbnail, and the thumbnail is at the end of the header (both  always  the\ncase if the photo came from a digital camera)\n"
                },
                {
                    "name": "-rgt",
                    "content": "Regenerate  exif  thumbnail.   'size'  specifies maximum height or width of thumbnail.\nRelies on 'mogrify' program (from ImageMagick) to regenerate the thumbnail.  This only\nworks if the image already contains a thumbnail.\n\n"
                }
            ]
        },
        "ROTATION OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-autorot",
                    "content": "Using  the  'Orientation'  tag  of the Exif header, rotate the image so that it is up‐\nright.  The program jpegtran is used to perform the rotation. This program is  present\nin  most Linux distributions.  For windows, you need to get a copy of it.  After rota‐\ntion, the orientation tag of the Exif header is set to '1' (normal orientation).   The\nthumbnail  is  also rotated. Other fields of the Exif header, including dimensions are\nuntouched, but the JPEG height/width are adjusted.  This feature is especially  useful\nwith  newer  Canon cameras, that set the orientation tag automatically using a gravity\nsensor.\n"
                },
                {
                    "name": "-norot",
                    "content": "the images were previously rotated without clearing the Exif rotation tag, as some im‐\nage browsers will auto rotate images when the rotation tag is set.  Sometimes,  thumb‐\nnails  and  rotation   tags  can  get  very out of sync from manipulation with various\ntools.  To reset it all use -norot with -rgt to clear this out.\n\n"
                }
            ]
        },
        "OUTPUT VERBOSITY CONTROL": {
            "content": "",
            "subsections": [
                {
                    "name": "-h",
                    "content": "",
                    "flag": "-h"
                },
                {
                    "name": "-v",
                    "content": "UNIX  programs,  Jhead  gives  feedback as to what it is doing, even when nothing goes\nwrong.  Windows user that I am, when something doesn't give me feedback  for  20  sec‐\nonds, I assume its crashed.\n",
                    "flag": "-v"
                },
                {
                    "name": "-q",
                    "content": "",
                    "flag": "-q"
                },
                {
                    "name": "-V -exifmap",
                    "content": "header. Useful when analyzing strange exif headers, not of much use  to  non  software\ndevelopers.\n",
                    "flag": "-V"
                },
                {
                    "name": "-se",
                    "content": ""
                },
                {
                    "name": "-c",
                    "content": "eral.  Useful for grep-ing through images, as well as  importing  into  spread  sheets\n(data is space delimited with quotes as text qualifier).\n\n",
                    "flag": "-c"
                }
            ]
        },
        "FILE MATCHING OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-model",
                    "content": "image information, contains the substring specified in the  argument  after  '-model'.\nFor example, the following command will list only images that are from an S100 camera:\n\njhead -model S100 *.jpg\n\nI  use  this option to restrict my JPEG recompensing to those images that came from my\nCanon S100 digicam, (see the -cmd option).\n"
                },
                {
                    "name": "-exonly",
                    "content": "Skip all files that don't have an Exif header.  Photos straight from a digital  camera\nhave an Exif header, whereas many photo manipulation tools discard the Exif header.\n\n"
                },
                {
                    "name": "-proc",
                    "content": "process files with baseline encoding.  Specifying \"-proc 2\" will  only  process  files\nwith progressive encoding.  This option is useful when converting files to progressive\njpegs using jpegtran, to skip those files already encoded as progressive  jpegs.   For\nexample, the following\ncommand  converts only files as baseline to progressive: jhead -proc 0 -cmd \"jpegtran\n-progressive -outfile &o &i\" *.jpg\n\n"
                },
                {
                    "name": "-cmd",
                    "content": "The Exif section of each file is read before running the command, and reinserted after\nthe command finishes.\n\nThe specified command invoked separately for each JPEG that is processed, even if mul‐\ntiple files are specified (explicitly or by wild card).\n\nExample use:\n\nHaving a whole directory of photos from my S100, I run the following commands:\n\njhead -cmd mogrify -quality 80 &i -model S100 *.jpg\njhead -cmd jpegtran -progressive &i > &o *.jpg\n\nThe first command mogrifies all JPEGs in the tree that indicate that they are  from  a\nCanon  S100  in  their  Exif  header to 80% quality at the same resolution.  This is a\n'lossy' process, so I only run it on files that are from the Canon, and  only  run  it\nonce.   The  next  command  then takes a JPEGs and converts them to progressive JPEGs.\nThe result is the same images, with no discernible differences,  stored  in  half  the\nspace.  This produces substantial savings on some cameras.\n\n"
                }
            ]
        },
        "SEE ALSO": {
            "content": "jpegtran(1), mogrify(1), rdjpgcom(1), wrjpgcom(1)\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Matthias Wandel\n",
            "subsections": []
        },
        "BUGS": {
            "content": "After  jhead  runs a program to rotate or resize an image, the image dimensions and thumbnail\nin the Exif header are not adjusted.\n\nModifying of Exif header data is very limited, as Jhead internally only has a read  only  im‐\nplementation  of  the file system contained in the Exif header.  For example, there is no way\nto replace the thumbnail or edit the Exif comment in the Exif header.  There is also  no  way\nto create minimal exif headers.\n\nSome  Canon  digital SLR cameras fail to adjust the effective sensor resolution when shooting\nat less than full resolution, causing jhead to incorrectly miscalculate the sensor width  and\n35mm equivalent focal length.  The same can result from resizing photos with Photoshop, which\nwill manipulate parts of the exif header.  This is often reported as  a  bug  in  Jhead,  but\nJhead can't do much about incorrect data.\n\nSend bug reports to matthias at woodgears dot ca\n\n",
            "subsections": []
        },
        "COPYING PERMISSIONS": {
            "content": "Jhead  is  'public  domain'.  You may freely copy jhead, and reuse part or all of its code in\nfree or proprietary programs.   I do however request that you do not post my  e-mail  address\nin ways that spam robots can harvest it.\n\n\n\njhead 3.06                                   24 Mar 2021                                    JHEAD(1)",
            "subsections": []
        }
    },
    "summary": "jhead - Digicam JPEG Exif header manipulation tool",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "jpegtran",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/jpegtran/1/json"
        },
        {
            "name": "mogrify",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/mogrify/1/json"
        },
        {
            "name": "rdjpgcom",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/rdjpgcom/1/json"
        },
        {
            "name": "wrjpgcom",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/wrjpgcom/1/json"
        }
    ]
}