一般来说,照相机拍下的照片都会留有信息,包括拍照的时间、相机的型号、光圈大小等,这些都记录在exif里。同样是jpg的文件,因为含有exif信息,使得它区别于普通的图片。比如,即使照片的名字改变,我们也可以通过照片记录的exif信息来知道拍摄日期。事实上,相机拍照的文件名字往往是"IMG_0638.jpg"之类,拷贝或者移动会改变照片的创建时间,修改又会给变照片的修改时间。要想知道拍摄时间,还是得看exif。
对于手机拍下的照片,一些会留下exif信息,一些不会。如我的手机android的camera360会,但是我用的另一款不知名的相机软件不会。出于这样的考虑,有时我要手动为自己的照片添加上拍摄日期。Exif包含的信息非常多,我这里主要对象是时间。
如何查看和修改exif?方法还是比较多的。
windows自己就可以
以一张图片为例,两种方法查看
1.属性
2.状态栏
下边显示拍摄日期
如何修改?很直接,点下就改了。
很简单吧。
不过这么改,第一,时间不能修改到秒;第二,只能一个个修改。
软件ACDSee也提供了修改Exif功能,比windows强一点,但是在exiftool面前真是小巫见大巫。
据我所知,网上尽是exif的查看工具,但是兼有exif修改功能的软件并不多。
所有信息就出来了:
可惜,exiftool是一个命令行工具,对于初上手是在晦涩难懂。这个工具提专业:
-这个工具可以批量的把固定的信息写入文件的Exif信息,比如把你自己的名字写到Exif中的作者一栏;
-这个工具可以对Exif信息中的一些参数值进行运算,比如你的相机时间设置因为跨时区旅游,忘记调整了,那么你可以用这个工具批量的在文件拍摄时间上加或者减几个小时;
-这个工具可以读出文件的Exif信息中某个/些字段,并把它们写入其他的字段(这个就是我现在在用的);
还有其他的一些很强大的功能,留给大家研究,比如写入GPS数据,清空EXIF信息等
其说明文件如下:
NAME
exiftool - Read and write meta information in files
RUNNING IN WINDOWS
Drag and drop files or folders onto the exiftool executable to display
meta information, or rename to "exiftool.exe" and run from the command
line to access all exiftool features.
This stand-alone Windows version allows simple command-line options to
be added to the name of the executable (in brackets and separated by
spaces at the end of the name), providing a mechanism to use options
when launched via the mouse. For example, changing the executable name
to "exiftool(-a -u -g1 -w txt).exe" gives a drag-and-drop utility which
generates sidecar ".txt" files with detailed meta information. As
shipped, the -k option is added to cause exiftool to pause before
terminating (to keep the command window open). Options may also be added
to the "Target" property of a Windows shortcut to the executable.
SYNOPSIS
exiftool [*OPTIONS*] [-*TAG*...] [--*TAG*...] *FILE*...
exiftool [*OPTIONS*] -*TAG*[+-<]=[*VALUE*]... *FILE*...
exiftool [*OPTIONS*] -tagsFromFile *SRCFILE* [-*SRCTAG*[>*DSTTAG*]...]
*FILE*...
exiftool [ -ver | -list[w|f|r|wf|g[*NUM*]|d|x] ]
For specific examples, see the EXAMPLES sections below.
This documentation is displayed if exiftool is run without an input
*FILE* when one is expected.
DESCRIPTION
A command-line interface to Image::ExifTool, used for reading and
writing meta information in image, audio and video files. *FILE* is one
or more source file names, directory names, or "-" for the standard
input. When reading, information from source files is output in readable
form to the console (or written to output text files with -w).
To write, copy or delete information, tag values are assigned using the
-*TAG*=[*VALUE*] syntax, or with the -tagsFromFile or -geotag options.
By default the original files are preserved with "_original" appended to
their names -- be sure to verify that the new files are OK before
erasing the originals. Once in write mode, exiftool will ignore any
read-specific options.
Note: If *FILE* is a directory name then only supported file types in
the directory are processed (in write mode only writable types are
processed). However, files may be specified by name, or the -ext option
may be used to force processing of files with any extension.
Below is a list of file types and meta information formats currently
supported by ExifTool (r = read, w = write, c = create):
File Types
------------+-------------+-------------+-------------+------------
3FR r | DYLIB r | KEY r | OTF r | RWL r/w
3G2 r | EIP r | LNK r | PAGES r | RWZ r
3GP r | EPS r/w | M2TS r | PBM r/w | RM r
ACR r | ERF r/w | M4A/V r | PDF r/w | SO r
AFM r | EXE r | MEF r/w | PEF r/w | SR2 r/w
AI r/w | EXIF r/w/c | MIE r/w/c | PFA r | SRF r
AIFF r | EXR r | MIFF r | PFB r | SRW r/w
APE r | F4A/V r | MKA r | PFM r | SVG r
ARW r/w | FFF r/w | MKS r | PGF r | SWF r
ASF r | FLA r | MKV r | PGM r/w | THM r/w
AVI r | FLAC r | MNG r/w | PICT r | TIFF r/w
BMP r | FLV r | MOS r/w | PMP r | TTC r
BTF r | FPX r | MOV r | PNG r/w | TTF r
CHM r | GIF r/w | MP3 r | PPM r/w | VRD r/w/c
COS r | GZ r | MP4 r | PPT r | VSD r
CR2 r/w | HDP r/w | MPC r | PPTX r | WAV r
CRW r/w | HDR r | MPG r | PS r/w | WDP r/w
CS1 r/w | HTML r | MPO r/w | PSB r/w | WEBP r
DCM r | ICC r/w/c | MQV r | PSD r/w | WEBM r
DCP r/w | IDML r | MRW r/w | PSP r | WMA r
DCR r | IIQ r/w | MXF r | QTIF r | WMV r
DFONT r | IND r/w | NEF r/w | RA r | X3F r/w
DIVX r | INX r | NRW r/w | RAF r/w | XCF r
DJVU r | ITC r | NUMBERS r | RAM r | XLS r
DLL r | J2C r | ODP r | RAR r | XLSX r
DNG r/w | JNG r/w | ODS r | RAW r/w | XMP r/w/c
DOC r | JP2 r/w | ODT r | RIFF r | ZIP r
DOCX r | JPEG r/w | OGG r | RSRC r |
DV r | K25 r | OGV r | RTF r |
DVB r | KDC r | ORF r/w | RW2 r/w |
Meta Information
----------------------+----------------------+---------------------
EXIF r/w/c | CIFF r/w | Ricoh RMETA r
GPS r/w/c | AFCP r/w | Picture Info r
IPTC r/w/c | Kodak Meta r/w | Adobe APP14 r
XMP r/w/c | FotoStation r/w | MPF r
MakerNotes r/w/c | PhotoMechanic r/w | Stim r
Photoshop IRB r/w/c | JPEG 2000 r | APE r
ICC Profile r/w/c | DICOM r | Vorbis r
MIE r/w/c | Flash r | SPIFF r
JFIF r/w/c | FlashPix r | DjVu r
Ducky APP12 r/w/c | QuickTime r | M2TS r
PDF r/w/c | Matroska r | PE/COFF r
PNG r/w/c | GeoTIFF r | AVCHD r
Canon VRD r/w/c | PrintIM r | ZIP r
Nikon Capture r/w/c | ID3 r | (and more)
。。。。。。(此处省略数万字,太长了)
那么如何修改照片的拍摄时间呢?
一条命令:exiftool -DateTimeOriginal="2011:10:02 12:28:10" SDC10419.jpg
再看,时间已经变掉了,同时生成备份文件*.jpg_original。
这样就很简单,自己想要怎么改就怎么改。
可以用批处理实现批量改名字,根据自己的需要修改代码,完全能得到自己想要的结果。
关于用exiftool修改时间,还有其他一些细节。我不一一列出,有兴趣的可以自己研究。
需要更详细的说明可以看这里http://www.sno.phy.queensu.ca/~phil/exiftool/faq.html
另外,exiftool有个界面版本exiftoolGUI,有兴趣可以一试。
注:批处理范例下载