Cubeの日記: ExIF 取得スクリプト
とりあえずやっつけ仕事.
[環境設定]
# perl -MCPAN -e shell
(省略)
CPAN>install Image::ExifTool
(省略)
CPAN>bye
[作成スクリプト]
#!/usr/bin/perl
use Image::ExifTool;
@Targets = @ARGV;
$exifTool = new Image::ExifTool;
foreach( @Targets ) {
$f = $_;
if ( -e $f ) {
$info = $exifTool->ImageInfo( $f );
print "[ExIF of $f]\n":
foreach( keys( %$info ) ) {
$k = $_;
$v = $exifTool->GetValue( $k );
printf( "%s -> %s\n", $k, $v );
} else {
print "$f not Found\n";
}
}
[実行方法]
perl スクリプト名 画像ファイル名
[実行見本 (画像は RICOH Caplio GX8 で撮影したTIFF)]
[hoge@localhost ~]$ perl ./exifview.pl R0010008.tif
[ExIF of R0010008.tif]
Model -> Caplio GX8
FlashpixVersion -> 0100
ShutterSpeed -> 0.3
ResolutionUnit -> inches
FocalLength35efl -> 0.6mm
LightSource -> Cool White Fluorescent
MeteringMode -> Center-weighted average
BitsPerSample -> 8 8 8
SamplesPerPixel -> 3
BrightnessValue -> 0
MIMEType -> image/tiff
Compression (1) -> Uncompressed
FileType -> TIFF
PlanarConfiguration (1) -> Chunky
ResolutionUnit (1) -> inches
ExifToolVersion -> 5.77
StripOffsets -> 1996
RowsPerStrip (1) -> 120
RicohDateTime2 -> 2005:06:27
ISO -> 64
ImageHeight -> 2448
PlanarConfiguration -> Chunky
Make -> RICOH
DateTimeOriginal -> 2005:12:05 22:08:13
ImageDescription ->
ApertureValue -> 2.5
YCbCrSubSampling -> YCbCr4:2:2
PhotometricInterpretation -> YCbCr
ExposureProgram -> Program AE
RicohDateTime1 -> 2005:10:15
MakerNoteType -> Rdc
Flash -> Off
YCbCrPositioning (1) -> Co-sited
MakerNoteVersion -> Rev0112
ModifyDate -> 2005:12:05 22:08:13
Orientation -> Horizontal (normal)
YCbCrPositioning -> Co-sited
FocalLength -> 0.6mm
PhotometricInterpretation (1) -> YCbCr
WhiteBalance -> Manual
FreeOffsets -> 0
ExifVersion -> 0221
ImageSize -> 3264x2448
XResolution (1) -> 72
ImageWidth -> 3264
ExposureTime -> 0.3
ImageHeight (1) -> 120
SamplesPerPixel (1) -> 3
ImageWidth (1) -> 160
Compression -> Uncompressed
RowsPerStrip -> 2448
Copyright -> (C) by Caplio GX8 User
FreeByteCounts -> 0
ExposureMode -> Auto
BitsPerSample (1) -> 8 8 8
FileName -> R0010008.tif
XResolution -> 72
StripOffsets (1) -> 40396
CreateDate -> 2005:12:05 22:08:13
UserComment ->
FileModifyDate -> 2005:12:07 10:02:07
ExposureCompensation -> 0
ColorSpace -> sRGB
Sharpness -> Normal
SceneCaptureType -> Standard
YCbCrSubSampling (1) -> YCbCr4:2:2
FileSize -> 15 MB
YResolution -> 72
Aperture -> 2.5
StripByteCounts -> 38400
YResolution (1) -> 72
MaxApertureValue -> 2.4
FNumber -> 2.5
StripByteCounts (1) -> 15980544
[hoge@localhost ~]$
ExIF 取得スクリプト More ログイン