"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "jhead.1" between
jhead-3.03.tar.gz and jhead-3.04.tar.gz

About: jhead is an Exif Jpeg header and thumbnail manipulation tool.

jhead.1  (jhead-3.03):jhead.1  (jhead-3.04)
skipping to change at line 73 skipping to change at line 73
are used under Windows and Unix respectively. After the editor ex its, the data is transferred are used under Windows and Unix respectively. After the editor ex its, the data is transferred
back into the image, and the temporary file deleted. back into the image, and the temporary file deleted.
-cs file -cs file
Save comment section to a file Save comment section to a file
-ci file -ci file
Replace comment with text from file Replace comment with text from file
-cl string -cl string
Replace comment with specified string from command line file Replace comment with specified string from command line
DATE / TIME MANIPULATION OPTIONS DATE / TIME MANIPULATION OPTIONS
-ft Sets the file's system time stamp to what is stored in the Exif he ader. -ft Sets the file's system time stamp to what is stored in the Exif he ader.
-dsft Sets the Exif timestamp to the file's timestamp. Requires an Exif header to pre-exist. Use -mkexif -dsft Sets the Exif timestamp to the file's timestamp. Requires an Exif header to pre-exist. Use -mkexif
option to create one if needed. option to create one if needed.
-n[format_string] -n[format_string]
This option causes files to be renamed and/ or mmoved using the da te information from the Exif This option causes files to be renamed and/ or mmoved using the da te information from the Exif
header "DateTimeOriginal" field. If the file is not an Exif fi le, or the DateTimeOriginal does header "DateTimeOriginal" field. If the file is not an Exif fi le, or the DateTimeOriginal does
not contain a valid value, the file date is used. Renaming is by not contain a valid value, the file date is used. If the new name
default restricted to files contains a '/', this will be
whose names consist largely of digits. This effectively restricts interpreted as a new path, and the file will be moved accordingly.
renaming to files that have not
already been manually renamed, as the default sequential names
from digital cameras consist
largely of digits. Use the -n option to force renaming of all fi
les. If the new name contains a
'/', this will be interpreted as a new path, and the file will be
moved accordingly.
If the format_string is omitted, the file will be renamed to MMDD- HHMMSS. Note that this scheme If the format_string is omitted, the file will be renamed to MMD D-HHMMSS. Note that this scheme
doesn't include the year (I never have photos from different years together anyway). doesn't include the year (I never have photos from different years together anyway).
If a format_string is provided, it will be passed to the strftim If a format_string is provided, it will be passed to the strftime
e function as the format string. function as the format string.
In addition, if the format string contains '%f', this will substit In addition, if the format string contains '%f', this will sub
ute the original name of the stitute the original name of the
file (minus extension). '%i' will substitute a sequence number. file (minus extension). '%i' will substitute a sequence number.
Leading zeros can be specified Leading zeros can be specified
like with printf - i.e. '%04i' pads the number to 4 digits using l eading zeros. like with printf - i.e. '%04i' pads the number to 4 digits using l eading zeros.
If the name includes '/', this is interpreted as a new path for th e file. If the new path does If the name includes '/', this is interpreted as a new path for the file. If the new path does
not exist, the path will be created. not exist, the path will be created.
If the target name already exists, the name will be appended wit h "a", "b", "c", etc, unless the If the target name already exists, the name will be appended with "a", "b", "c", etc, unless the
name ends with a letter, in which case it will be appended with "0 ", "1", "2", etc. name ends with a letter, in which case it will be appended with "0 ", "1", "2", etc.
This feature is especially useful if more than one digital camera was used to take pictures of an This feature is especially useful if more than one digital camera was used to take pictures of an
event. By renaming them to a scheme according to date, they will automatically appear in order of event. By renaming them to a scheme according to date, they will automatically appear in order of
taking in most directory listings and image browsers. Alternative taking in most directory listings and image browsers. Alternati
ly, if your image browser sup- vely, if your image browser sup-
ports listing by file time, you can use the -ft option to set the ports listing by file time, you can use the -ft option to set the
file time to the time the photo file time to the time the photo
was taken. was taken.
Some of the more useful arguments for strftime are: Some of the more useful arguments for strftime are:
%H Hour in 24-hour format (00 - 23) %H Hour in 24-hour format (00 - 23)
%j Day of year as decimal number (001 - 366) %j Day of year as decimal number (001 - 366)
%m Month as decimal number (01 - 12) %m Month as decimal number (01 - 12)
%M Minute as decimal number (00 - 59) %M Minute as decimal number (00 - 59)
%S Second as decimal number (00 - 59) %S Second as decimal number (00 - 59)
%w Weekday as decimal number (0 - 6; Sunday is 0) %w Weekday as decimal number (0 - 6; Sunday is 0)
%y Year without century, as decimal number (00 - 99) %y Year without century, as decimal number (00 - 99)
%Y Year with century, as decimal number %Y Year with century, as decimal number
Example: Example:
jhead -n%Y%m%d-%H%M%S *.jpg jhead -n%Y%m%d-%H%M%S *.jpg
This will rename files matched by *.jpg in the format YYYYMMDD-HHM MSS This will rename files matched by *.jpg in the format YYYYMMDD-HHM MSS
For a full listing of strftime arguments, look up the strftime in For a full listing of strftime arguments, look up the strftime in
them man pages. Note that some them man pages. Note that some
arguments to the strftime function (not listed here) produce str arguments to the strftime function (not listed here) produce strin
ings with characters such as ':' gs with characters such as ':'
that may not be valid as part of a filename on some systems. that may not be valid as part of a filename on some systems.
-ta<+|-><timediff> -ta<+|-><timediff>
Adjust time stored in the Exif header by h:mm forwards or backward Adjust time stored in the Exif header by h:mm forwards or back
s. Useful when having taken wards. Useful when having taken
pictures with the wrong time set on the camera, such as after pictures with the wrong time set on the camera, such as after trav
travelling across time zones, or elling across time zones, or
when daylight savings time has changed. when daylight savings time has changed.
Examples: Examples:
Add 1 hourand 5 minutes to the time Add 1 hourand 5 minutes to the time
jhead -ta+1:05 jhead -ta+1:05
Decrease time by one second: Decrease time by one second:
jhead -ta-0:0:1 jhead -ta-0:0:1
This option changes all Date/time fields in the exif header, inc luding "DateTimeOriginal" (tag This option changes all Date/time fields in the exif header, i ncluding "DateTimeOriginal" (tag
0x9003) and "DateTimeDigitized" (tag 0x9004). 0x9003) and "DateTimeDigitized" (tag 0x9004).
-da<newdate>-<olddate> -da<newdate>-<olddate>
Works like -ta, but for specifying large date offsets, to be use Works like -ta, but for specifying large date offsets, to be used
d when fixing dates from cameras when fixing dates from cameras
where the date was set incorrectly, such as having date and time r where the date was set incorrectly, such as having date and time
eset by battery removal on some reset by battery removal on some
cameras cameras
Because different months and years have different numbers of d Because different months and years have different numbers of days
ays in them, a simple offset for in them, a simple offset for
months, days, years would lead to unexpected results at times. Th months, days, years would lead to unexpected results at times. T
e time offset is thus specified he time offset is thus specified
as a difference between two dates, so that jhead can figure out as a difference between two dates, so that jhead can figure out ex
exactly how many days the time- actly how many days the time-
stamp needs to be adjusted by, including leap years and daylight s stamp needs to be adjusted by, including leap years and daylight
avings time changes. The dates savings time changes. The dates
are specified as yyyy:mm:dd. For sub-day adjustments, a time are specified as yyyy:mm:dd. For sub-day adjustments, a time of d
of day can also be included, by ay can also be included, by
specifying yyyy:nn:dd/hh:mm or yyyy:mm:dd/hh:mm:ss specifying yyyy:nn:dd/hh:mm or yyyy:mm:dd/hh:mm:ss
Examples: Examples:
Year on camera was set to 2005 instead of 2004 for pictures taken in April Year on camera was set to 2005 instead of 2004 for pictures taken in April
jhead -da2004:03:01-2005:03:01 jhead -da2004:03:01-2005:03:01
Default camera date is 2002:01:01, and date was reset on 2005:05:2 9 at 11:21 am Default camera date is 2002:01:01, and date was reset on 2005:05:2 9 at 11:21 am
jhead -da2005:05:29/11:21-2002:01:01 jhead -da2005:05:29/11:21-2002:01:01
-ts Sets the time stored in the Exif header to what is specified on th e command line. Time must be -ts Sets the time stored in the Exif header to what is specified on the command line. Time must be
specified as: yyyy:mm:dd-hh:mm:ss specified as: yyyy:mm:dd-hh:mm:ss
-ds Sets the date stored in the Exif header to what is specified on t he command line. Can be used to -ds Sets the date stored in the Exif header to what is specified on th e command line. Can be used to
set date, just year and month, or just year. Date is specified as : yyyy:mm:dd, yyyy:mm, or yyyy set date, just year and month, or just year. Date is specified as : yyyy:mm:dd, yyyy:mm, or yyyy
THUMBNAIL MANIPULATION OPTIONS THUMBNAIL MANIPULATION OPTIONS
-dt Delete thumbnails from the Exif header, but leave the interesting parts intact. This option trun- -dt Delete thumbnails from the Exif header, but leave the interesting parts intact. This option trun-
cates the thumbnail from the Exif header, provided that the thumbn ail is the last part of the Exif cates the thumbnail from the Exif header, provided that the thumbn ail is the last part of the Exif
header (which so far as I know is always the case). Exif headers have a built-in thumbnail, which header (which so far as I know is always the case). Exif headers have a built-in thumbnail, which
typically occupies around 10k of space. This thumbnail is used typically occupies around 10k of space. This thumbnail is used by
by digital cameras. Windows XP digital cameras. Windows XP
may also use this thumbnail if present (but it doesn't need it). may also use this thumbnail if present (but it doesn't need it).
The thumbnails are too small to The thumbnails are too small to
use even full screen on the digicam's LCD. I have not encount use even full screen on the digicam's LCD. I have not encountered
ered any adverse side effects of any adverse side effects of
deleting the thumbnails, even from the software provided with my o deleting the thumbnails, even from the software provided with m
ld Olympus digicam. Use with y old Olympus digicam. Use with
caution. caution.
-st file -st file
Save the integral thumbnail to file The thumbnail lives inside the Exif header, and is a very low- Save the integral thumbnail to file The thumbnail lives inside the Exif header, and is a very low-
res JPEG image. Note that making any changes to a photo, except f or with some programs, generally res JPEG image. Note that making any changes to a photo, except f or with some programs, generally
wipes out the Exif header and with it the thumbnail. wipes out the Exif header and with it the thumbnail.
The thumbnail is too low res to really use for very much. The thumbnail is too low res to really use for very much.
This feature has an interesting 'relative path' option for speci This feature has an interesting 'relative path' option for specify
fying the thumbnail name. When- ing the thumbnail name. When-
ever the name for file contains the characters '&i', jhead will s ever the name for file contains the characters '&i', jhead will
ubstitute the original filename substitute the original filename
for this name. This allows creating a 'relative name' when do for this name. This allows creating a 'relative name' when doing
ing a whole batch of files. For a whole batch of files. For
example, the incantation: example, the incantation:
jhead -st "thumbnails/&i" *.jpg jhead -st "thumbnails/&i" *.jpg
would create a thumbnail for each .jpg file in the thumbnails dire would create a thumbnail for each .jpg file in the thumbnails d
ctory by the same name, (pro- irectory by the same name, (pro-
vided that the thumbnails directory exists, of course). Both vided that the thumbnails directory exists, of course). Both Win3
Win32 and UNIX shells treat the 2 and UNIX shells treat the
'&'character in a special way, so you have to put quotes around th '&'character in a special way, so you have to put quotes around
at command line option for the that command line option for the
'&' to even be passed to the program. '&' to even be passed to the program.
If a '-' is specified for the output file, the thumbnail is sent t o stdout. (UNIX build only) If a '-' is specified for the output file, the thumbnail is sent t o stdout. (UNIX build only)
-rt Replace thumbnails from the Exif header. This only works if th -rt Replace thumbnails from the Exif header. This only works if the e
e exif header already contains a xif header already contains a
thumbnail, and the thumbnail is at the end of the header (both alw thumbnail, and the thumbnail is at the end of the header (both a
ays the case if the photo came lways the case if the photo came
from a digital camera) from a digital camera)
-rgt size -rgt size
Regenerate exif thumbnail. 'size' specifies maximum height o Regenerate exif thumbnail. 'size' specifies maximum height or wi
r width of thumbnail. Relies on dth of thumbnail. Relies on
'mogrify' program (from ImageMagick) to regenerate the thumbnail. 'mogrify' program (from ImageMagick) to regenerate the thumbnai
This only works if the image l. This only works if the image
already contains a thumbnail. already contains a thumbnail.
ROTATION OPTIONS ROTATION OPTIONS
-autorot -autorot
Using the 'Orientation' tag of the Exif header, rotate the image Using the 'Orientation' tag of the Exif header, rotate the image s
so that it is upright. The pro- o that it is upright. The pro-
gram jpegtran is used to perform the rotation. This program is pre gram jpegtran is used to perform the rotation. This program is
sent in most Linux distribu- present in most Linux distribu-
tions. For windows, you need to get a copy of it. After rota tions. For windows, you need to get a copy of it. After rotation
tion, the orientation tag of the , the orientation tag of the
Exif header is set to '1' (normal orientation). The thumbnail is Exif header is set to '1' (normal orientation). The thumbnail
also rotated. Other fields of is also rotated. Other fields of
the Exif header, including dimensions are untouched, but the JPEG height/width are adjusted. This the Exif header, including dimensions are untouched, but the JPEG height/width are adjusted. This
feature is especially useful with newer Canon cameras, that set th e orientation tag automatically feature is especially useful with newer Canon cameras, that set t he orientation tag automatically
using a gravity sensor. using a gravity sensor.
-norot Clears the rotation field in the Exif header without altering -norot Clears the rotation field in the Exif header without altering the
the image. Useful if the images image. Useful if the images
were previously rotated without clearing the Exif rotation tag, as were previously rotated without clearing the Exif rotation tag,
some image browsers will auto as some image browsers will auto
rotate images when the rotation tag is set. Sometimes, thumbnails and rotation tags can get very rotate images when the rotation tag is set. Sometimes, thumbnails and rotation tags can get very
out of sync from manipulation with various tools. To reset it all use -norot with -rgt to clear out of sync from manipulation with various tools. To reset it a ll use -norot with -rgt to clear
this out. this out.
OUTPUT VERBOSITY CONTROL OUTPUT VERBOSITY CONTROL
-h Displays summary of command line options. -h Displays summary of command line options.
-v Makes the program even more verbose than it already is. Like DO -v Makes the program even more verbose than it already is. Like DOS
S programs, and unlike UNIX pro- programs, and unlike UNIX pro-
grams, Jhead gives feedback as to what it is doing, even when noth grams, Jhead gives feedback as to what it is doing, even when n
ing goes wrong. Windows user othing goes wrong. Windows user
that I am, when something doesn't give me feedback for 20 seconds, I assume its crashed. that I am, when something doesn't give me feedback for 20 seconds, I assume its crashed.
-q No output on success, more like Unix programs. -q No output on success, more like Unix programs.
-V Print version info and compilation date. -exifmap Show a map of the bytes in the exif header. -V Print version info and compilation date. -exifmap Show a map of t he bytes in the exif header.
Useful when analyzing strange exif headers, not of much use to non software developers. Useful when analyzing strange exif headers, not of much use to non software developers.
-se Suppress error messages relating to corrupt Exif header structure. -se Suppress error messages relating to corrupt Exif header structure.
-c Concise output. This causes picture info to be summarized on one line instead of several. Useful -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 shee ts (data is space delimited with for grep-ing through images, as well as importing into spread shee ts (data is space delimited with
quotes as text qualifier). quotes as text qualifier).
FILE MATCHING OPTIONS FILE MATCHING OPTIONS
-model Restricts processing of files to those whose camera model, as indi cated by the Exif image informa- -model Restricts processing of files to those whose camera model, as indi cated by the Exif image informa-
tion, contains the substring specified in the argument after '-mod el'. For example, the following tion, contains the substring specified in the argument after '-mod el'. For example, the following
command will list only images that are from an S100 camera: command will list only images that are from an S100 camera:
jhead -model S100 *.jpg jhead -model S100 *.jpg
I use this option to restrict my JPEG recompensing to those images that came from my Canon S100 I use this option to restrict my JPEG recompensing to those ima ges that came from my Canon S100
digicam, (see the -cmd option). digicam, (see the -cmd option).
-exonly -exonly
Skip all files that don't have an Exif header. Photos straight fr om a digital camera have an Exif Skip all files that don't have an Exif header. Photos straight fr om a digital camera have an Exif
header, whereas many photo manipulation tools discard the Exif hea der. header, whereas many photo manipulation tools discard the Exif hea der.
-cmd Executes the specified command on each JPEG file to be processed. -cmd Executes the specified command on each JPEG file to be processed.
The Exif section of each file is read before running the command, and reinserted after the command The Exif section of each file is read before running the command, and reinserted after the command
finishes. finishes.
The specified command invoked separately for each JPEG that is p rocessed, even if multiple files The specified command invoked separately for each JPEG that is pro cessed, even if multiple files
are specified (explicitly or by wild card). are specified (explicitly or by wild card).
Example use: Example use:
Having a whole directory of photos from my S100, I run the followi ng commands: Having a whole directory of photos from my S100, I run the followi ng commands:
jhead -cmd "mogrify -quality 80 &i" -model S100 *.jpg jhead -cmd "mogrify -quality 80 &i" -model S100 *.jpg
jhead -cmd "jpegtran -progressive &i > &o" *.jpg jhead -cmd "jpegtran -progressive &i > &o" *.jpg
The first command mogrifies all JPEGs in the tree that indicate th at they are from a Canon S100 in The first command mogrifies all JPEGs in the tree that indicate th at they are from a Canon S100 in
their Exif header to 80% quality at the same resolution. This is a 'lossy' process, so I only run 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 ne it on files that are from the Canon, and only run it once. The
xt command then takes a JPEGs next command then takes a JPEGs
and converts them to progressive JPEGs. The result is the same and converts them to progressive JPEGs. The result is the same im
images, with no discernible dif- ages, with no discernible dif-
ferences, stored in half the space. This produces substantial sav ings on some cameras. ferences, stored in half the space. This produces substantial sav ings on some cameras.
SEE ALSO SEE ALSO
jpegtran(1), mogrify(1), rdjpgcom(1), wrjpgcom(1) jpegtran(1), mogrify(1), rdjpgcom(1), wrjpgcom(1)
AUTHOR AUTHOR
Matthias Wandel Matthias Wandel
BUGS BUGS
After jhead runs a program to rotate or resize an image, the image dimens ions and thumbnail in the Exif After jhead runs a program to rotate or resize an image, the image dime nsions and thumbnail in the Exif
header are not adjusted. header are not adjusted.
Modifying of Exif header data is very limited, as Jhead internally only h as a read only implementation of Modifying of Exif header data is very limited, as Jhead internally only h as a read only implementation of
the file system contained in the Exif header. For example, there is no w ay to replace the thumbnail or the file system contained in the Exif header. For example, there is no way to replace the thumbnail or
edit the Exif comment in the Exif header. There is also no way to create minimal exif headers. edit the Exif comment in the Exif header. There is also no way to create minimal exif headers.
Some Canon digital SLR cameras fail to adjust the effective sensor resol Some Canon digital SLR cameras fail to adjust the effective sensor resolu
ution when shooting at less than tion when shooting at less than
full resolution, causing jhead to incorrectly miscalculate the sensor wid full resolution, causing jhead to incorrectly miscalculate the sensor
th and 35mm equivalent focal width and 35mm equivalent focal
length. The same can result from resizing photos with Photoshop, which w ill manipulate parts of the exif length. The same can result from resizing photos with Photoshop, which w ill manipulate parts of the exif
header. This is often reported as a bug in Jhead, but Jhead can't do muc h about incorrect data. header. This is often reported as a bug in Jhead, but Jhead can't do muc h about incorrect data.
Send bug reports to mwandel at sentex dot net. Send bug reports to mwandel at sentex dot net.
COPYING PERMISSIONS COPYING PERMISSIONS
Jhead is 'public domain'. You may freely copy jhead, and reuse part or a ll of its code in free or pro- Jhead is 'public domain'. You may freely copy jhead, and reuse part or all of its code in free or pro-
prietary programs. I do however request that you do not post my e-mail address in ways that spam robots prietary programs. I do however request that you do not post my e-mail address in ways that spam robots
can harvest it. can harvest it.
jhead 3.03 11 Dec 2018 JHEAD(1) jhead 3.04 22 Nov 2019 JHEAD(1)
 End of changes. 34 change blocks. 
110 lines changed or deleted 103 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)