📄 exif.pm
字号:
Start => '$valuePtr+8', }, }, { Condition => '$::cameraMake=~/^NIKON/ and $::cameraModel=~/^(E700|E800|E900|E900S|E910|E950)$/', Name => 'MakerNoteNikon1', SubDirectory => { TagTable => 'TagTables::Nikon::nikon1_tags', Start => '$valuePtr+8', }, }, { Condition => '$::cameraMake=~/^NIKON/', Name => 'MakerNoteNikon2', SubDirectory => { TagTable => 'TagTables::Nikon::nikon2_tags', Start => '$valuePtr', }, }, { Condition => '$::cameraMake=~/^CASIO/', Name => 'MakerNoteCasio', SubDirectory => { TagTable => 'TagTables::Casio::Main', Start => '$valuePtr', }, }, { Name => 'MakerNoteUnknown', }, ], #---------------------------------------------------------------------------- 0x9286 => 'UserComment', 0x9290 => 'SubSecTime', 0x9291 => 'SubSecTimeOriginal', 0x9292 => 'SubSecTimeDigitized', 0xa000 => 'FlashPixVersion', 0xa001 => { Name => 'ColorSpace', PrintConv => { 1 => 'sRGB', 2 => 'Adobe RGB', 0xffff => 'Uncalibrated', }, }, 0xa002 => 'ExifImageWidth', 0xa003 => 'ExifImageLength', 0xa004 => 'RelatedSoundFile', 0xa005 => 'InteroperabilityOffset', 0xa20b => 'FlashEnergy', 0xa20c => 'SpatialFrequencyResponse', 0xa20e => 'FocalPlaneXResolution', 0xa20f => 'FocalPlaneYResolution', 0xa210 => { Name => 'FocalPlaneResolutionUnit', ValueConv => { 1 => '25.4', 2 => '25.4', 3 => '10', 4 => '1', 5 => '0.001', }, PrintConv => { 25.4 => 'inches', 10 => 'cm', 1 => 'mm', 0.001 => 'um', }, }, 0xa214 => 'SubjectLocation', 0xa215 => 'ExposureIndex', 0xa217 => { Name => 'SensingMethod', PrintConv => { 1 => 'Not defined', 2 => 'One-chip color area', 3 => 'Two-chip color area', 4 => 'Three-chip color area', 5 => 'Color sequential area', 7 => 'Trilinear', 8 => 'Color sequential linear', }, }, 0xa300 => { Name => 'FileSource', PrintConv => { 3 => 'Digital Camera', }, }, 0xa301 => { Name => 'SceneType', PrintConv => { 1 => 'Directly photographed', }, }, 0xa302 => 'CFAPattern', 0xa401 => { Name => 'CustomRendered', PrintConv => { 0 => 'Normal', 1 => 'Custom', }, }, 0xa402 => { Name => 'ExposureMode', PrintConv => { 0 => 'Auto', 1 => 'Manual', 2 => 'Auto bracket', }, }, 0xa403 => { Name => 'WhiteBalance', Condition => 'not defined($oldVal)', # don't override maker WhiteBalance PrintConv => { 0 => 'Auto', 1 => 'Manual', }, }, 0xa404 => 'DigitalZoomRatio', 0xa405 => 'FocalLengthIn35mmFormat', 0xa406 => { Name => 'SceneCaptureType', PrintConv => { 0 => 'Standard', 1 => 'Landscape', 2 => 'Portrait', 3 => 'Night', }, }, 0xa407 => { Name => 'GainControl', PrintConv => { 0 => 'None', 1 => 'Low gain up', 2 => 'High gain up', 3 => 'Low gain down', 4 => 'High gain down', }, }, 0xa408 => { Name => 'Contrast', PrintConv => 'TagTables::Exif::PrintParameter($val)', }, 0xa409 => { Name => 'Saturation', PrintConv => 'TagTables::Exif::PrintParameter($val)', }, 0xa40a => { Name => 'Sharpness', PrintConv => 'TagTables::Exif::PrintParameter($val)', }, 0xa40b => 'DeviceSettingDescription', 0xa40c => { Name => 'SubjectDistanceRange', PrintConv => { 1 => 'Macro', 2 => 'Close', 3 => 'Distant', }, }, 0xa420 => 'ImageUniqueID',);# the Composite tags are evaluated last, and are used# to calculate values based on the other tags# (the main script looks for the special 'Composite' hash)%TagTables::Exif::Composite = ( ImageSize => { Require => { 0 => 'ImageWidth', 1 => 'ImageHeight', }, ValueConv => '"$val[0]x$val[1]"', }, # pick the best shutter speed value ShutterSpeed => { Description => 'Tv(Shutter Speed)', Desire => { 0 => 'ExposureTime', 1 => 'ShutterSpeedValue', 2 => 'BulbDuration', }, ValueConv => '$val[2] ? $val[2] : (defined($val[0]) ? $val[0] : $val[1])', PrintConv => 'TagTables::Exif::PrintExposureTime($val)', }, Aperture => { Description => 'Av(Aperture Value)', Desire => { 0 => 'FNumber', 1 => 'ApertureValue', }, ValueConv => '$val[0] ? $val[0] : $val[1]', PrintConv => 'sprintf("%.1f",$val)', }, FocalLength35efl => { Description => 'Focal Length', Require => { 0 => 'FocalLength', }, Desire => { 1 => 'ScaleFactor35efl', }, ValueConv => '$val[0] * ($val[1] ? $val[1] : 1)', PrintConv => '$val[1] ? sprintf("%.1fmm (35mm equivalent: %.1fmm)", $val[0], $val) : sprintf("%.1fmm", $val)', }, ThumbnailImage => { Require => { 0 => 'ThumbnailOffset', 1 => 'ThumbnailLength', }, ValueConv => '$::thumb_data', PrintConv => '"(Thumbnail image)"', }, ScaleFactor35efl => { Description => 'Scale Factor to 35mm Equivalent', Desire => { 0 => 'FocalLength', 1 => 'FocalLengthIn35mmFormat', 2 => 'FocalPlaneResolutionUnit', 3 => 'FocalPlaneXResolution', 4 => 'FocalPlaneYResolution', 5 => 'CanonImageWidthAsShot', 6 => 'CanonImageHeightAsShot', 7 => 'ExifImageWidth', 8 => 'ExifImageLength', 9 => 'ImageWidth', 10 => 'ImageHeight', }, ValueConv => 'TagTables::Exif::CalcScaleFactor35efl(@val)', PrintConv => 'sprintf("%.1f", $val)', },);# this is a special table used to define command-line shortcuts%TagTables::Exif::Shortcuts = ( Common => [ 'FileName', 'FileSize', 'Model', 'DateTimeOriginal', 'ImageSize', 'Quality', 'FocalLength', 'ShutterSpeed', 'Aperture', 'ISO', 'WhiteBalance', 'Flash', ], Canon => [ 'FileName', 'Model', 'DateTimeOriginal', 'ShootingMode', 'ShutterSpeed', 'Aperture', 'MeteringMode', 'ExposureCompensation', 'ISO', 'Lens', 'FocalLength', 'ImageSize', 'Quality', 'FlashOn', 'FlashType', 'ConditionalFEC', 'RedEyeReduction', 'ShutterCurtainHack', 'WhiteBalance', 'FocusMode', 'Contrast', 'Sharpness', 'Saturation', 'ColorTone', 'FileSize', 'FileNumber', 'DriveMode', 'OwnerName', 'SerialNumber', ],);#------------------------------------------------------------------------------# Calculate scale factor for 35mm effective focal length# Inputs: 0) Focal length# 1) Focal length in 35mm format# 2) focal plane resolution units (in mm)# 3/4) Focal plane X/Y resolution# 5/6,7/8...) Image width/height in order of precidence (first valid pair is used)# Returns: 35mm conversion factor (or undefined if it can't be calculated)sub CalcScaleFactor35efl{ my $focal = shift; my $foc35 = shift; return $foc35 / $focal if $focal and $foc35; my $units = shift || return undef; my $x_res = shift || return undef; my $y_res = shift || return undef; my ($w, $h); for (;;) { @_ < 2 and return undef; $w = shift; $h = shift; last if $w and $h; } # calculate focal plane size in mm $w *= $units / $x_res; $h *= $units / $y_res; return sqrt(36*36+24*24) / sqrt($w*$w+$h*$h);}#------------------------------------------------------------------------------# Convert exposure compensation fraction#sub ConvertFraction($){ my $val = shift; my $str; if (defined $val) { $val *= 1.00001; # avoid round-off errors if (not $val) { $str = '0'; } elsif (int($val)/$val > 0.999) { $str = sprintf("%+d", int($val)); } elsif ((int($val*2))/($val*2) > 0.999) { $str = sprintf("%+d/2", int($val * 2)); } elsif ((int($val*3))/($val*3) > 0.999) { $str = sprintf("%+d/3", int($val * 3)); } else { $str = sprintf("%.3g", $val); } } return $str;}#------------------------------------------------------------------------------# Print parameter value (with sign, or 'Normal' for zero)sub PrintParameter($) { my $val = shift; if ($val > 0) { $val = "+$val"; } elsif ($val == 0) { $val = 'Normal'; } return $val;}#------------------------------------------------------------------------------# Print exposure time as a fractionsub PrintExposureTime($){ my $secs = shift; if ($secs < 0.25001) { return sprintf("1/%d",int(0.5 + 1/$secs)); } $_ = sprintf("%.1f",$secs); s/\.0$//; return $_;}1; # end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -