jhead:编辑exif的利刃
2009-01-08 11:29:51
jhead.rar (50.84K)
jhead是一个运行在命令行的编辑exif的工具.
刚刚找到的, 用jhead -h可以列出帮助.
简单翻译了一下,部分翻译是在网上找的.
Jhead is a program for manipulating settings and thumnails in Exif jpeg headers
used by most Digital Cameras. v2.82 Matthias Wandel, Apr 03 2008.
http://www.sentex.net/~mwandel/jhead
Usage: jhead [options] files
Where:
files
path/filenames with or without wildcards
[options] are:
命令行: jhead [参数] 文件名
文件名: 可以是使用/不使用通配符的文件/路径
GENERAL METADATA:
-te <name>
Transfer exif header from another image file <name>
Uses same name mangling as ‘-st’ option
从其他的jpg文件里导出exif信息加入到当前文件.
这个参数可以配合 -st 一起使用
-dc
Delete comment field (as left by progs like Photoshop & Compupic)
删除jpg信息中的备注.
注意,jpg文件有两个备注,一是和其他文件一样的备注,另一个是exif信息中的备注.
jhead仅对exif信息有效.
-de
Strip Exif section (smaller JPEG file, but lose digicam info)
完全删除exif信息.
-di
Delete IPTC section (from Photoshop, or Picasa)
删除IPTC (Photoshop 格式兼容)信息.
-dx
Deletex XMP section
删除XMP(photoshop文件信息)
-du
Delete non image sections except for Exif and comment sections
删除非原始exif信息,例如Photoshop之类编辑后修改exif留下的信息.
-purejpg
Strip all unnecessary data from jpeg (combines -dc -de and -du)
删除所有jpeg文件非必须的信息. 相当于-de、-dc和-du的集合,可以将文件减小数k.
-mkexif
Create new minimal exif section (overwrites pre-existing exif)
创建新的最小exif信息(覆盖原有的的exif信息)
-ce
Edit comment field. Uses environment variable ‘editor’ to
determine which editor to use. If editor not set, uses VI
under Unix and notepad with windows
编辑exif信息.
使用的编辑器取决于系统环境变量’editor’的值.
如果没有设置,则调用Unix或windows的记事本.
例:
set editor=D:\Progra~1\1st\UEDIT\Uedit32.exe
jhead -ce X:\1.jpg
-cs <name>
Save comment section to a file
导出备注.
例:
jhead -cs X:\1.txt D:\1.jpg
-ci <name>
Insert comment section from a file.
-cs and -ci use same naming
scheme as used by the -st option
导入备注.
例:
jhead -ci X:\1.txt X:\1.jpg
-cl string
Insert literal comment string
直接输入备注.
例:
jhead -cl 备注 X:\1.jpg
DATE / TIME MANIPULATION:
-ft
Set file modification time to Exif time
把文件修改文件设置为exif记录的时间.
-dsft
Set Exif time to file modification time
把文件exif信息时间设置为文件修改时间.
-n[format-string]
Rename files according to date. Uses exif date if present, file
date otherwise. If the optional format-string is not supplied,
the format is mmdd-hhmmss. If a format-string is given, it is
is passed to the ‘strftime’ function for formatting
In addition to strftime format codes:
‘%f’ as part of the string will include the original file name
‘%i’ will include a sequence number, starting from 1. You can
You can specify ‘%03i’ for example to get leading zeros.
This feature is useful for ordering files from multiple digicams to
sequence of taking. Only renames files whose names are mostly
numerical (as assigned by digicam)
The ‘.jpg’ is automatically added to the end of the name. If the
destination name already exists, a letter or digit is added to
the end of the name to make it unique.
将文件名修改为exif信息中记录的“创建时间”;
如果jpg文件没有exif或者exif中的创建时间不可用,
则将文件名修改为文件的“修改时间”.
如果使用了[format-string]参数,则使用这个参数指定的格式重命名文件.
格式-顺序参数如下:
%d-日(01-31)
%H-小时(00-23)
%j-一年中的第几天(001-366)
%m-月(01-12)
%M-分钟(00-59)
%S-秒(00-59)
%U-一年中的第几周(00-53)
%w-星期几(0-6,周日为0)
%y-两位数纪年(00-99)
%Y-四位数几年
%i-添加数字序号
%f-原文件名
例:
jhead -n%Y%m%d-%H%M%S X:\*.jpg
将所有jpg文件修改为YYYYMMDD-HHMMSS.jpg的格式.
-nf[format-string]
Same as -n, but rename regardless of original name
-nf 与"-n"相同功能相同,不保留原文件名.
-a
(Windows only) Rename files with same name but different extension
Use together with -n to rename .AVI files from exif in .THM files
for example
修改不同扩展名的同名文件名,相机拍摄的avi短片exif信息存储在与其同名的thm文件中,
可用此指令给avi文件更名. 一般与“-n”指令共同使用.
-ta<+|->h[:mm[:ss]]
Adjust time by h:mm backwards or forwards. Useful when having
taken pictures with the wrong time set on the camera, such as when
traveling across time zones or DST changes. Dates can be adjusted
by offsetting by 24 hours or more. For large date adjustments,
use the -da option
修正时差,例如时差根据时区确定,例如+1:00或者-1:00,如穿越时区或DST更改.
可在24小时内调整,大的日期修改使用 -da 参数.
-da <date>-<date>
Adjust date by large amounts. This is used to fix photos from
cameras where the date got set back to the default camera date
by accident or battery removal.
To deal with different months and years having different numbers of
days, a simple date-month-year offset would result in unexpected
results. Instead, the difference is specified as desired date
minus original date. Date is specified as yyyy:mm:dd or as date
and time in the format yyyy:mm:dd/hh:mm:ss
修正日期.
日期格式是yyyy:mm:dd、yyyy:nn:dd+hh:mm或者 yyyy:mm:dd+hh:mm:ss.
根据前后参数时间差调整exif的时间.
-ts <time>
Set the Exif internal time to <time>. <time> is in the format
yyyy:mm:dd-hh:mm:ss
直接修改exif中的拍摄时间,
时间格式为yyyy:mm:dd-hh:mm:ss
-ds<date>
Set the Exif internal date. <date> is in the format YYYY:MM:DD
or YYYY:MM or YYYY
直接修改exif中的拍摄日期,
日期格式为YYYY:MM:DD 或 or YYYY:MM 或 YYYY
THUMBNAIL MANIPULATION:
-dt
Remove exif integral thumbnails. Typically trims 10k
删除exif中的缩略图. 这个缩略图一般为240×160象素,10k大小.
-st <name>
Save Exif thumbnail, if there is one, in file <name>
If output file name contains the substring "&i" then the
image file name is substitute for the &i. Note that quotes around
the argument are required for the ‘&’ to be passed to the program.
将exif中的缩略图复制为另一个jpg文件
-rt <name>
Replace Exif thumbnail. Can only be done with headers that
already contain a thumbnail.
用另一个jpg文件替换exif中的缩略图.
-rgt[size]
Regnerate exif thumbnail. Only works if image already
contains a thumbail. size specifies maximum height or width of
thumbnail. Relies on ‘mogrify’ programs to be on path
刷新exif缩略图,其中[size]为缩略图的最大边长.
ROTATION TAG MANIPULATION:
-autorot
Invoke jpegtran to rotate images according to Exif orientation tag
Note: Windows users must get jpegtran for this to work
根据exif中记录的水平方向信息转动jpeg照片.
windows必须使用这个信息来处理图片.
-norot
Zero out the rotation tag.
This to avoid some browsers from
rotating the image again after you rotated it but neglected to
clear the rotation tag
清除exif中的水平方向信息.
OUTPUT VERBOSITY CONTROL:
-h
help (this text)
-v
even more verbose output
详细的图片信息显示.
-q
Quiet (no messages on success, like Unix)
安静模式(不输出信息).
-V
Show jhead version
-exifmap
Dump header bytes, annotate. Pipe thru sort for better viewing
显示头信息,exif信息.通过管道输出更适合阅读.
试了下,这样用的:
jhead -exifmap 1.jpg |more
-se
Supress error messages relating to corrupt exif header structure
剔除错误的exif信息?
-c
concise output
简化输出.
例:
X:\>jhead -c 1.jpg
"1.jpg" 1600×1200 (1/666) f/3.2
-nofinfo
Don’t show file info (name/size/date)
不显示文件信息
FILE MATCHING AND SELECTION:
-model model
Only process files from digicam containing model substring in
camera model description
仅仅应用数码设备所设定模式?
-exonly
Skip all files that don’t have an exif header (skip all jpegs that
were not created by digicam)
不处理没有exif信息的文件.
-cmd command
Apply ‘command’ to every file, then re-insert exif and command
sections into the image. &i will be substituted for the input file
name, and &o (if &o is used). Use quotes around the command string
This is most useful in conjunction with the free ImageMagick tool.
For example, with my Canon S100, which suboptimally compresses
jpegs I can specify
调用其他程序并应用到每一个图片文件.
jhead -cmd "mogrify -quality 80 &i" *.jpg
to re-compress a lot of images using ImageMagick to half the size,
and no visible loss of quality while keeping the exif header
Another invocation I like to use is jpegtran (hard to find for
windows). I type:
jhead -cmd "jpegtran -progressive &i &o" *.jpg
to convert jpegs to progressive jpegs (Unix jpegtran syntax
differs slightly)
-orp
Only operate on ‘portrait’ aspect ratio images
调整"portrait"模式文件的纵横比.
-orl
Only operate on ‘landscape’ aspect ratio images
调整"landscape"模式文件的纵横比.
-r
No longer supported.
Use the ** wildcard to recurse directories with instead.
examples:
jhead **/*.jpg
jhead "c:\my photos\**\*.jpg"
不支持长文件名.
使用 ** 通配符来代替子目录名
Permalink : http://13jl.com/1051430.html
No Comment