diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Image/ExifTool.pm | 9 | ||||
-rw-r--r-- | lib/Image/ExifTool/Import.pm | 42 | ||||
-rw-r--r-- | lib/Image/ExifTool/Lang/pl.pm | 110 | ||||
-rw-r--r-- | lib/Image/ExifTool/Panasonic.pm | 1 | ||||
-rw-r--r-- | lib/Image/ExifTool/Sony.pm | 292 | ||||
-rw-r--r-- | lib/Image/ExifTool/TagLookup.pm | 33 | ||||
-rw-r--r-- | lib/Image/ExifTool/TagNames.pod | 38 | ||||
-rw-r--r-- | lib/Image/ExifTool/Writer.pl | 72 |
8 files changed, 520 insertions, 77 deletions
diff --git a/lib/Image/ExifTool.pm b/lib/Image/ExifTool.pm index 95233978..05501519 100644 --- a/lib/Image/ExifTool.pm +++ b/lib/Image/ExifTool.pm @@ -27,7 +27,7 @@ use vars qw($VERSION $RELEASE @ISA @EXPORT_OK %EXPORT_TAGS $AUTOLOAD @fileTypes %mimeType $swapBytes $swapWords $currentByteOrder %unpackStd %jpegMarker %specialTags); -$VERSION = '9.81'; +$VERSION = '9.82'; $RELEASE = ''; @ISA = qw(Exporter); %EXPORT_TAGS = ( @@ -116,6 +116,7 @@ sub Exists($$); sub IsDirectory($$); sub Rename($$$); sub Unlink($@); +sub GetFileTime($$); sub DoEscape($$); sub ConvertFileSize($); sub ParseArguments($;@); #(defined in attempt to avoid mod_perl problem) @@ -3042,6 +3043,11 @@ sub EncodeFileName($$;$) # recode as UTF-8 for other platforms if necessary $_[1] = $self->Decode($file, $enc, undef, 'UTF8') unless $enc eq 'UTF8'; } + } elsif ($^O eq 'MSWin32' and $file =~ /[\x80-\xff]/) { + require Image::ExifTool::XMP; + if (Image::ExifTool::XMP::IsUTF8(\$file) < 0) { + $self->WarnOnce('FileName encoding not specified'); + } } return 0; } @@ -3097,6 +3103,7 @@ sub Exists($$) my ($self, $file) = @_; if ($self->EncodeFileName($file)) { + local $SIG{'__WARN__'} = \&SetWarning; my $wh = Win32API::File::CreateFileW($file, Win32API::File::GENERIC_READ(), 0, [], Win32API::File::OPEN_EXISTING(), 0, []); return 0 unless $wh; diff --git a/lib/Image/ExifTool/Import.pm b/lib/Image/ExifTool/Import.pm index 8e2ac525..b35d6d0e 100644 --- a/lib/Image/ExifTool/Import.pm +++ b/lib/Image/ExifTool/Import.pm @@ -12,7 +12,7 @@ require Exporter; use vars qw($VERSION @ISA @EXPORT_OK); -$VERSION = '1.03'; +$VERSION = '1.04'; @ISA = qw(Exporter); @EXPORT_OK = qw(ReadCSV ReadJSON); @@ -23,7 +23,7 @@ my $charset; #------------------------------------------------------------------------------ # Read CSV file -# Inputs: 0) CSV file name, 1) database hash ref, 2) missing tag value +# Inputs: 0) CSV file name or file ref, 1) database hash ref, 2) missing tag value # Returns: undef on success, or error string # Notes: There are various flavours of CSV, but here we assume that only # double quotes are escaped, and they are escaped by doubling them @@ -31,11 +31,17 @@ sub ReadCSV($$;$) { local ($_, $/); my ($file, $database, $missingValue) = @_; - my ($buff, @tags, $found, $err); + my ($buff, @tags, $found, $err, $raf, $openedFile); - open CSVFILE, $file or return "Error opening CSV file '$file'"; - binmode CSVFILE; - my $raf = new File::RandomAccess(\*CSVFILE); + if (ref $file eq 'GLOB') { + $raf = new File::RandomAccess($file); + $file = 'CSV file'; + } else { + open CSVFILE, $file or return "Error opening CSV file '$file'"; + binmode CSVFILE; + $openedFile = 1; + $raf = new File::RandomAccess(\*CSVFILE); + } # set input record separator by first newline found in the file # (safe because first line should contain only tag names) while ($raf->Read($buff, 65536)) { @@ -93,7 +99,7 @@ sub ReadCSV($$;$) @tags or $err = 'No tags found', last; } } - close CSVFILE; + close CSVFILE if $openedFile; undef $raf; $err = 'No SourceFile column' unless $found or $err; return $err ? "$err in $file" : undef; @@ -213,20 +219,28 @@ Tok: for (;;) { #------------------------------------------------------------------------------ # Read JSON file -# Inputs: 0) JSON file name, 1) database hash ref, 2) flag to delete "-" tags -# 2) character set +# Inputs: 0) JSON file name or file ref, 1) database hash ref, +# 2) flag to delete "-" tags, 3) character set # Returns: undef on success, or error string sub ReadJSON($$;$$) { local $_; my ($file, $database, $missingValue, $chset) = @_; + my ($fp, $openedFile); # initialize character set for converting "\uHHHH" chars $charset = $chset || 'UTF8'; - open JSONFILE, $file or return "Error opening JSON file '$file'"; - binmode JSONFILE; - my $obj = ReadJSONObject(\*JSONFILE); - close JSONFILE; + if (ref $file eq 'GLOB') { + $fp = $file; + $file = 'JSON file'; + } else { + open JSONFILE, $file or return "Error opening JSON file '$file'"; + binmode JSONFILE; + $fp = \*JSONFILE; + $openedFile = 1; + } + my $obj = ReadJSONObject($fp); + close $fp if $openedFile; unless (ref $obj eq 'ARRAY') { ref $obj eq 'HASH' or return "Format error in JSON file '$file'"; $obj = [ $obj ]; @@ -279,7 +293,7 @@ Read CSV or JSON file into a database hash. =item Inputs: -0) CSV file name. +0) CSV file name or file reference. 1) Hash reference for database object. diff --git a/lib/Image/ExifTool/Lang/pl.pm b/lib/Image/ExifTool/Lang/pl.pm index d4aca155..13caa7b5 100644 --- a/lib/Image/ExifTool/Lang/pl.pm +++ b/lib/Image/ExifTool/Lang/pl.pm @@ -11,9 +11,10 @@ package Image::ExifTool::Lang::pl; use strict; use vars qw($VERSION); -$VERSION = '1.09'; +$VERSION = '1.10'; %Image::ExifTool::Lang::pl::Translate = ( + 'A100DataOffset' => 'Przesunięcie danych A100', 'AEAperture' => 'Priorytet AE', 'AEExposureTime' => 'Czas ekspozycji AE', 'AEInfo' => 'Informacja o automatycznej ekspozycji', @@ -92,6 +93,7 @@ $VERSION = '1.09'; }, }, 'AvApertureSetting' => 'Ustawienia priorytetu przysłony Av', + 'BadFaxLines' => 'Uszkodzone wiersze transmisji Fax', 'BannerImageType' => { PrintConv => { 'None' => 'Brak', @@ -176,8 +178,29 @@ $VERSION = '1.09'; 'CellLength' => 'Długość komórki', 'CellWidth' => 'Szerokość komórki', 'City' => 'Miasto', + 'CleanFaxData' => { + Description => 'Poprawne wiersze transmisji Fax', + PrintConv => { + 'Clean' => 'Dobry', + 'Regenerated' => 'Ponowiony', + 'Unclean' => 'Niedobry', + }, + }, + 'ClipPath' => 'Ścieżka obcięcia', + 'CodingMethods' => { + Description => 'Metody kompresji', + PrintConv => { + 'Baseline JPEG' => 'JPEG podstawowa', + 'JBIG color' => 'JBIG kolor', + 'Modified Huffman' => 'Huffmana zmodyfikowana', + 'Modified MR' => 'Zmodyfikowany MR', + 'Modified Read' => 'Zmodyfikowany odczyt', + 'Unspecified compression' => 'Nie podane', + }, + }, 'ColorFilter' => 'Filtr kolorowy', 'ColorInfo' => 'Informacje o kolorze', + 'ColorMap' => 'Mapa kolorów', 'ColorMatrix1' => 'Macierz kolorów 1', 'ColorMatrix2' => 'Macierz kolorów 2', 'ColorSpace' => { @@ -219,6 +242,7 @@ $VERSION = '1.09'; 'None' => 'Brak', }, }, + 'ConsecutiveBadFaxLines' => 'Sekwencja uszkodzonych wierszy transmisji Fax', 'Contrast' => { Description => 'Kontrast', PrintConv => { @@ -260,10 +284,13 @@ $VERSION = '1.09'; 'None' => 'Brak', }, }, + 'DataType' => 'Typ daty', 'Date' => 'Data', 'DateCreated' => 'Data utworzenia', 'DateSent' => 'Wysłano datę', 'DateTimeOriginal' => 'Pierwotna data i godzina', + 'Decode' => 'Zdekodowany', + 'DefaultImageColor' => 'Domyślny kolor w obrazie', 'Description' => 'Opis', 'DestinationCity' => 'Miasto przeznaczenia', 'DestinationCityCode' => 'Kod miasta przeznaczenia', @@ -366,6 +393,19 @@ $VERSION = '1.09'; 'Rotate 90 CW' => '90° CCW (prawo/góra)', }, }, + 'FaxProfile' => { + Description => 'Profil faxu (rodzaj zawartości)', + PrintConv => { + 'Extended B&W lossless, F' => 'Rozszerzony cz.b. bezstratny, F', + 'Lossless JBIG B&W, J' => 'Bezstratny JBIG cz.b., J', + 'Lossless color and grayscale, L' => 'Bezstratne kolor i skala szarości, L', + 'Lossy color and grayscale, C' => 'Stratne kolor i skala szarości, C', + 'Minimal B&W lossless, S' => 'Minimalny cz.b. bezstratny, S', + 'Mixed raster content, M' => 'Raster — zawartość mieszana, M', + 'Multi Profiles' => 'Wiele profili', + 'Unknown' => 'Nieznany', + }, + }, 'FileFormat' => 'Format', 'FileModifyDate' => 'Data aktualizacji', 'FileName' => 'Nazwa pliku', @@ -548,6 +588,9 @@ $VERSION = '1.09'; }, 'Genre' => 'Gatunek', 'Gradation' => 'Gradacja', + 'GrayResponseCurve' => 'Krzywa odpowiedzi Szarości', + 'GrayResponseUnit' => 'Wielkość jednostki dla krzywej odpowiedzi szarości', + 'HalftoneHints' => 'Półtony', 'Headline' => 'Nagłówek', 'HighISONoiseReduction' => 'Redukcja szumu przy wysokim ISO', 'HometownCity' => 'Miasto domowe', @@ -569,6 +612,7 @@ $VERSION = '1.09'; 'ImageDescription' => 'Opis obrazu', 'ImageEditCount' => 'Licznik przetworzonych zdjęć', 'ImageHeight' => 'Wysokość obrazu', + 'ImageID' => 'Identyfikator obrazu', 'ImageProcessing' => 'Przetwarzanie obrazu', 'ImageSize' => 'Rozmiar zdjęcia', 'ImageTone' => { @@ -590,6 +634,20 @@ $VERSION = '1.09'; 'ImageUniqueID' => 'Unikalny kod ID zdjęcia', 'ImageWidth' => 'Szerokość obrazu', 'Index' => 'Indeks', + 'Indexed' => { + Description => 'Indeksowane', + PrintConv => { + 'Indexed' => 'Indeksowane', + 'Not indexed' => 'Nie indeksowane', + }, + }, + 'InkNames' => 'Nazwy tuszy', + 'InkSet' => { + Description => 'Zestaw tuszy', + PrintConv => { + 'Not CMYK' => 'Nie CMYK', + }, + }, 'Instructions' => 'Instrukcje', 'InternalFlashMode' => 'Tryb wewnętrznej lampy', 'InternalFlashStrength' => 'Moc wewnętrznej lampy', @@ -603,12 +661,19 @@ $VERSION = '1.09'; }, 'InteropOffset' => 'Znacznik wzajemnej zgodności', 'InteropVersion' => 'Wersja wzajemnej zgodności', + 'JPEGProc' => { + PrintConv => { + 'Baseline' => 'JPEG Podstawowy', + 'Lossless' => 'Bezstratny', + }, + }, 'JPEGQuality' => { Description => 'Jakość', PrintConv => { 'Standard' => 'Standardowa jakość', }, }, + 'JPEGRestartInterval' => 'JPEG odstęp restartów', 'Keywords' => 'Słowa kluczowe', 'Lens' => 'Obiektyw', 'LensID' => 'ID obiektywu', @@ -649,6 +714,7 @@ $VERSION = '1.09'; 'MakerNote' => 'Prywatne dane DNG', 'MakerNotes' => 'Dane producenta', 'MaxAperture' => 'Maks. przysłona obiektywu', + 'MaxSampleValue' => 'Maksymalny rozmiar próbki', 'MeasurementGeometry' => { Description => 'Geometria pomiaru', PrintConv => { @@ -671,6 +737,8 @@ $VERSION = '1.09'; 'Unknown' => 'Nieznane', }, }, + 'MinSampleValue' => 'Minimalny rozmiar próbki', + 'ModeNumber' => 'Numer trybu', 'Model' => 'Aparat', 'ModifiedPictureStyle' => { PrintConv => { @@ -695,6 +763,7 @@ $VERSION = '1.09'; }, }, 'NativeDisplayInfo' => 'Informacja o natywnym(?) wyświetlaczu', + 'Noise' => 'Szumy', 'NoiseReduction' => { Description => 'Redukcja szumów', PrintConv => { @@ -702,12 +771,14 @@ $VERSION = '1.09'; 'On' => 'Włączona', }, }, + 'NumberofInks' => 'Liczba tuszy', 'ObjectFileType' => { PrintConv => { 'None' => 'Brak', }, }, 'OldSubfileType' => { + Description => 'Stary typ podsekcji', PrintConv => { 'Full-resolution image' => 'Obraz w pełnej rozdzielczości', 'Reduced-resolution image' => 'Obraz o zredukowanej rozdzielczości', @@ -728,6 +799,8 @@ $VERSION = '1.09'; 'Rotate 90 CW' => '90° CCW (prawo/góra)', }, }, + 'OwnerName' => 'Nazwa właściciela', + 'PageName' => 'Nazwa strony', 'PageNumber' => 'Numer strony', 'PentaxImageSize' => { Description => 'Rozmiar obrazu Pentax\'a', @@ -786,6 +859,13 @@ $VERSION = '1.09'; }, }, 'PowerSource' => 'Zasilanie', + 'Predictor' => { + Description => 'Przelicznik', + PrintConv => { + 'Horizontal differencing' => 'W oparciu o różnicę w poziomie', + 'None' => 'Bez przelicznika', + }, + }, 'Preview0' => 'Podgląd 0', 'Preview1' => 'Podgląd 1', 'Preview2' => 'Podgląd 2', @@ -822,6 +902,12 @@ $VERSION = '1.09'; 'ProfileDescription' => 'Opis profilu', 'ProfileDescriptionML' => 'Wielojęzyczny opis profilu.', 'ProfileSequenceDesc' => 'Opis sekwencji profilu', + 'ProfileType' => { + Description => 'Typ profilu', + PrintConv => { + 'Unspecified' => 'Nie podany', + }, + }, 'ProfileVersion' => 'Wersja profilu', 'ProgramLine' => 'Linia programu', 'ProgramMode' => { @@ -840,6 +926,8 @@ $VERSION = '1.09'; 'Normal' => 'Standardowa jakość', }, }, + 'Rating' => 'Ocena', + 'RatingPercent' => 'Ocena procentowo', 'RawImageSize' => 'Rozmiar obrazu RAW', 'RecordMode' => 'Tryb zapisu', 'RedBalance' => 'Balans czerwonego', @@ -880,6 +968,15 @@ $VERSION = '1.09'; 'RowsPerStrip' => 'Liczba rzędów w pasku', 'SRFocalLength' => 'Długość fokalna SR', 'SRResult' => 'Stabilizacja obrazu', + 'SampleFormat' => { + Description => 'Format próbki', + PrintConv => { + 'Float' => 'Zmienno przecinkowa', + 'Signed' => 'Całkowita ze znakiem', + 'Undefined' => 'Nie podano', + 'Unsigned' => 'Całkowita bez znaku', + }, + }, 'SamplesPerPixel' => 'Liczba składników', 'Saturation' => { Description => 'Nasycenie', @@ -965,6 +1062,7 @@ $VERSION = '1.09'; 'SubSecTimeDigitized' => '"Cyfrowa data i godzina, subsekundy"', 'SubSecTimeOriginal' => '"Pierwotna data i godzina, sub-sekundy"', 'SubfileType' => { + Description => 'Typ podsekcji', PrintConv => { 'Full-resolution Image' => 'Obraz w pełnej rozdzielczości', 'Reduced-resolution image' => 'Obraz o zredukowanej rozdzielczości', @@ -996,6 +1094,12 @@ $VERSION = '1.09'; }, 'SupplementalCategories' => 'Kategorie dodatkowe', 'SvISOSetting' => 'Ustawienia ISO Sv', + 'T6Options' => { + PrintConv => { + 'Uncompressed' => 'Nieskompresowany', + }, + }, + 'TargetPrinter' => 'Docelowa drukarka', 'Technology' => { Description => 'Technologia', PrintConv => { @@ -1022,6 +1126,7 @@ $VERSION = '1.09'; }, }, 'Text' => 'Tekst', + 'Thresholding' => 'Progowanie', 'ThumbnailImage' => 'Miniatura', 'ThumbnailImageSize' => 'Rozmiar miniaturki', 'TileByteCounts' => 'Liczba bajtów na kafelek', @@ -1059,6 +1164,7 @@ $VERSION = '1.09'; 'Unknown' => 'Nieznany', 'Urgency' => 'Priorytet', 'UserComment' => 'Komentarz użytkownika', + 'VersionYear' => 'Rok wersji', 'VideoCardGamma' => 'Gamma karty graficznej', 'WBAdjLighting' => { PrintConv => { @@ -1118,6 +1224,7 @@ $VERSION = '1.09'; }, }, 'Writer-Editor' => 'Autor podpisu', + 'XClipPathUnits' => 'Jednostki wzdłuż osi X dla ścieżki obcięcia', 'XPosition' => 'Współrzędna X', 'XResolution' => 'Rozdzielczość obrazu w poziomie', 'YCbCrCoefficients' => 'Współczynniki matrycy transformacji przestrzeni barwowej', @@ -1129,6 +1236,7 @@ $VERSION = '1.09'; }, }, 'YCbCrSubSampling' => 'Współczynnik podpróbkowania(?) Y do C', + 'YClipPathUnits' => 'Jednostki wzdłuż osi Y dla ścieżki obcięcia', 'YPosition' => 'Współrzędna Y', 'YResolution' => 'Rozdzielczość obrazu w pionie', 'Year' => 'Rok', diff --git a/lib/Image/ExifTool/Panasonic.pm b/lib/Image/ExifTool/Panasonic.pm index 28cc391a..b371d0f8 100644 --- a/lib/Image/ExifTool/Panasonic.pm +++ b/lib/Image/ExifTool/Panasonic.pm @@ -2001,6 +2001,7 @@ my %shootingMode = ( Notes => 'A Composite tag derived from Model, SceneMode and AdvancedSceneType.', '0 1' => 'Off', # '0 7' - seen this for V-LUX movies (PH) + # '0 8' - seen for D-LUX(Typ104) movies (PH) '2 2' => 'Outdoor Portrait', #(FZ28) '2 3' => 'Indoor Portrait', #(FZ28) '2 4' => 'Creative Portrait', #(FZ28) diff --git a/lib/Image/ExifTool/Sony.pm b/lib/Image/ExifTool/Sony.pm index 180af230..531555b1 100644 --- a/lib/Image/ExifTool/Sony.pm +++ b/lib/Image/ExifTool/Sony.pm @@ -31,7 +31,7 @@ use Image::ExifTool qw(:DataAccess :Utils); use Image::ExifTool::Exif; use Image::ExifTool::Minolta; -$VERSION = '2.16'; +$VERSION = '2.17'; sub ProcessSRF($$$); sub ProcessSR2($$$); @@ -367,7 +367,7 @@ my %meterInfo2 = ( ], # 0x0018 - starts with "GYRO" for sweep panorama images (ref 12) # - contains ImageStabilization information for Minolta - 0x0020 => [ # not present for NEX-5C + 0x0020 => [ { Name => 'FocusInfo', #PH # count: A200/A230/A290/A300/A330/A350/A380/A390==19154, A700/A850/A900=19148 @@ -522,12 +522,31 @@ my %meterInfo2 = ( Name => 'PreviewImage', Writable => 'undef', DataTag => 'PreviewImage', + Notes => 'HD-size preview in JPEG images from almost all DSLR/SLT/ILCA/NEX/ILCE.', # Note: the preview data starts with a 32-byte proprietary Sony header + # first 8 bytes after 32-byte header: + # \x00\xd8\xff\xe1\x00\x27\xff\xff for JPEG files from A33/35/55V/450/500/550/560/580, NEX-3/5/5C/C3/VG10 + # \x00\xd8\xff\xdb\x00\x84\x00\x01 for JPEG files from all other models + # ( \xff\xd8\xff\xdb\x00\x84\x00\x01 corresponding bytes for all ARW files ) + # + # DSLR-A700/A850/A900 and DSLR-A200/A300/A350: + # - no MPImage2 + # DSLR-A230/A290/A330/A380/A390: + # - PreviewImage start-offset is at 110 bytes inside MPImage2 + # DSLR-A450/A500/A550/A560/A580, SLT-A33/A35/A55V, NEX-3/5/5C/C3/VG10/VG10E: + # - PreviewImage start-offset is at 106 bytes inside MPImage2 + # - different first bytes after 32-byte header + # SLT-A37/A57/A58/A65V/A77V/A99V, ILCA-77M2, NEX-3N/5N/5R/5T/6/7/F3, ILCE-3000/3500/5000/6000/7/7R/7S: + # - PreviewImage start-offset is at 130 bytes inside MPImage2 + # NEX-VG20E/VG30E/VG900, ILCE-QX1: 0x2001 not present + # ILCE-5100/ILCE-7M2 : 0x2001 present but Size 0 and Offset 0 + # WriteCheck => 'return $val=~/^(none|.{32}\xff\xd8\xff)/s ? undef : "Not a valid image"', RawConv => q{ return \$val if $val =~ /^Binary/; $val = substr($val,0x20) if length($val) > 0x20; - return \$val if $val =~ s/^.(\xd8\xff\xdb)/\xff$1/s; +# return \$val if $val =~ s/^.(\xd8\xff\xdb)/\xff$1/s; + return \$val if $val =~ s/^.(\xd8\xff[\xdb\xe1])/\xff$1/s; $$self{PreviewError} = 1 unless $val eq 'none'; return undef; }, @@ -713,7 +732,7 @@ my %meterInfo2 = ( # a2 d3 - DSC-WX60, WX80, WX200, WX300 # a3 c3 - NEX-6, DSC-HX300, HX50V # a4 c3 - NEX-3N/5R/5T, ILCE-3000/3500 - # unknown offsets or values for DSC-TX20/TX55/RX100M2/RX100M3/QX10/QX30/QX100/RX10/HX60V/HX400V/WX220/WX350, + # unknown offsets or values for DSC-TX20/TX55/RX100M2/RX100M3/QX10/QX30/QX100/RX10/HX60V/HX400V/WX30/WX220/WX350, # ILCE-7/7R/7S/7M2/5000/5100/6000/QX1, ILCA-77M2 { Name => 'Tag2010a', # ad @@ -3128,6 +3147,20 @@ my %faceInfo = ( PrintConv => 'Image::ExifTool::Exif::PrintFNumber($val)', PrintConvInv => '$val', }, + 0x02 => { #12 (requires external flash) + Name => 'HighSpeedSync', + PrintConv => { + 0 => 'Off', + 1 => 'On', + }, + }, + 0x03 => { #12 + Name => 'ExposureCompensationSet', + ValueConv => '($val - 128) / 24', + ValueConvInv => 'int($val * 24 + 128.5)', + PrintConv => '$val ? sprintf("%+.1f",$val) : $val', + PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)', + }, 0x04 => { #7/12 Name => 'DriveMode', Mask => 0xff, # (not sure what upper byte is for) @@ -3147,21 +3180,34 @@ my %faceInfo = ( 0x0b => 'Mirror Lock-up', #12 (A850/A900; not on A700) }, }, - 0x06 => { #7 (A700, not valid for other models?) + 0x05 => { #12 + Name => 'WhiteBalanceSetting', + PrintConv => { + 2 => 'Auto', + 4 => 'Daylight', + 5 => 'Fluorescent', + 6 => 'Tungsten', + 7 => 'Flash', + 16 => 'Cloudy', + 17 => 'Shade', + 18 => 'Color Temperature/Color Filter', + 32 => 'Custom 1', + 33 => 'Custom 2', + 34 => 'Custom 3', + }, + }, + 0x06 => { #7 (A700) (ref 12: at least also valid for A200, ValueConv as for ColorCompensationFilterSet) Name => 'WhiteBalanceFineTune', - Condition => '$$self{Model} =~ /DSLR-A700\b/', - Format => 'int16s', - Notes => 'A700 only', + ValueConv => '$val > 128 ? $val - 256 : $val', }, - 0x0c => { #12 - Name => 'ColorTemperatureSetting', - # matches "0xb021 ColorTemperature" when WB set to "Custom" or "Color Temperature/Color Filter" + 0x07 => { #12 as set in WB "Color Temperature/Color Filter" and in White Balance Bracketing + Name => 'ColorTemperatureSet', ValueConv => '$val * 100', ValueConvInv => '$val / 100', PrintConv => '"$val K"', PrintConvInv => '$val =~ s/ ?K$//i; $val', }, - 0x0d => { #12 + 0x08 => { #12 as set in WB "Color Temperature/Color Filter" Name => 'ColorCompensationFilterSet', Notes => 'negative is green, positive is magenta', ValueConv => '$val > 128 ? $val - 256 : $val', @@ -3169,6 +3215,36 @@ my %faceInfo = ( PrintConv => '$val > 0 ? "+$val" : $val', PrintConvInv => '$val', }, + 0x0c => { #12 as set in WB "Custom" and in White Balance Bracketing + Name => 'ColorTemperatureCustom', + ValueConv => '$val * 100', + ValueConvInv => '$val / 100', + PrintConv => '"$val K"', + PrintConvInv => '$val =~ s/ ?K$//i; $val', + }, + 0x0d => { #12 as set in WB "Custom" + Name => 'ColorCompensationFilterCustom', + Notes => 'negative is green, positive is magenta', + ValueConv => '$val > 128 ? $val - 256 : $val', + ValueConvInv => '$val < 0 ? $val + 256 : $val', + PrintConv => '$val > 0 ? "+$val" : $val', + PrintConvInv => '$val', + }, + 0x0f => { #12 + Name => 'WhiteBalance', + PrintConv => { + 2 => 'Auto', + 4 => 'Daylight', + 5 => 'Fluorescent', + 6 => 'Tungsten', + 7 => 'Flash', + 12 => 'Color Temperature', + 13 => 'Color Filter', + 14 => 'Custom', + 16 => 'Cloudy', + 17 => 'Shade', + }, + }, 0x10 => { #7 (A700) Name => 'FocusModeSetting', PrintConv => { @@ -3210,6 +3286,26 @@ my %faceInfo = ( 11 => 'Far Left', # (presumably A700 only) }, }, + 0x13 => { + Name => 'FlashMode', + PrintConv => { + 0 => 'Autoflash', + 2 => 'Rear Sync', + 3 => 'Wireless', + 4 => 'Fill-flash', + 5 => 'Suppressed', #nc, seen for A200 Sunset and Landscape Scene-mode + 6 => 'Flash Off', #nc, seen for A200 + }, + }, + 0x14 => { #12 + Name => 'FlashExposureCompSet', + Description => 'Flash Exposure Comp. Setting', + # (as pre-selected by the user, not zero if flash didn't fire) + ValueConv => '($val - 128) / 24', #PH + ValueConvInv => 'int($val * 24 + 128.5)', + PrintConv => '$val ? sprintf("%+.1f",$val) : $val', + PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)', + }, 0x15 => { #7 Name => 'MeteringMode', PrintConv => { @@ -3302,10 +3398,11 @@ my %faceInfo = ( PrintConvInv => '$val', }, 0x23 => { - Name => 'FlashMode', + Name => 'FlashControl', PrintConv => { 0 => 'ADI', - 1 => 'TTL', + 1 => 'Pre-flash TTL', + 2 => 'Manual', }, }, 0x28 => { #7 @@ -3392,6 +3489,15 @@ my %faceInfo = ( Name => 'ImageStabilizationSetting', PrintConv => { 0 => 'Off', 1 => 'On' }, }, + 0x3e => { #12 + Name => 'FlashAction', + PrintConv => { + 0 => 'Did not fire', + 1 => 'Fired', + 2 => 'External Flash, Did not fire', + 3 => 'External Flash, Fired', + }, + }, 0x3f => { # (verified for A330/A380) Name => 'Rotation', PrintConv => { @@ -3400,6 +3506,26 @@ my %faceInfo = ( 2 => 'Rotate 270 CW', }, }, + 0x40 => { #12 + Name => 'AELock', + PrintConv => { + 1 => 'Off', + 2 => 'On', + }, + }, + 0x4c => { #12 + Name => 'FlashAction2', + PrintConv => { + 1 => 'Fired, Autoflash', + 2 => 'Fired, Fill-flash', + 3 => 'Fired, Rear Sync', + 4 => 'Fired, Wireless', + 5 => 'Did not fire', + 17 => 'Fired, Autoflash, Red-eye reduction', + 18 => 'Fired, Fill-flash, Red-eye reduction', + 34 => 'Fired, Fill-flash, HSS', + }, + }, 0x4d => { #12 Name => 'FocusMode', # (focus mode actually used) PrintConv => { @@ -3471,6 +3597,13 @@ my %faceInfo = ( 50 => '1/2 EV', }, }, + 0x6a => { #12 + Name => 'RedEyeReduction', + PrintConv => { + 0 => 'Off', + 1 => 'On', + }, + }, 0x9a => { #12 Name => 'FolderNumber', Mask => 0x03ff, # (not sure what the upper 6 bits are for) @@ -3507,17 +3640,49 @@ my %faceInfo = ( PrintConv => 'Image::ExifTool::Exif::PrintFNumber($val)', PrintConvInv => '$val', }, + 0x02 => { #12 (requires external flash) + Name => 'HighSpeedSync', + PrintConv => { + 0 => 'Off', + 1 => 'On', + }, + }, + 0x03 => { #12 + Name => 'ExposureCompensationSet', + ValueConv => '($val - 128) / 24', + ValueConvInv => 'int($val * 24 + 128.5)', + PrintConv => '$val ? sprintf("%+.1f",$val) : $val', + PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)', + }, ### 0x04-0x11: subtract 1 from CameraSettings TagID - # 0x05 - maybe WhiteBalanceFineTune - 0x0b => { #12 - Name => 'ColorTemperatureSetting', - # matches "0xb021 ColorTemperature" when WB set to "Custom" or "Color Temperature/Color Filter" + 0x04 => { #12 + Name => 'WhiteBalanceSetting', + PrintConv => { + 2 => 'Auto', + 4 => 'Daylight', + 5 => 'Fluorescent', + 6 => 'Tungsten', + 7 => 'Flash', + 16 => 'Cloudy', + 17 => 'Shade', + 18 => 'Color Temperature/Color Filter', + 32 => 'Custom 1', + 33 => 'Custom 2', + 34 => 'Custom 3', + }, + }, + 0x05 => { #12 + Name => 'WhiteBalanceFineTune', + ValueConv => '$val > 128 ? $val - 256 : $val', + }, + 0x06 => { #12 as set in WB "Color Temperature/Color Filter" and in White Balance Bracketing + Name => 'ColorTemperatureSet', ValueConv => '$val * 100', ValueConvInv => '$val / 100', PrintConv => '"$val K"', PrintConvInv => '$val =~ s/ ?K$//i; $val', }, - 0x0c => { #12 + 0x07 => { #12 as set in WB "Color Temperature/Color Filter" Name => 'ColorCompensationFilterSet', Notes => 'negative is green, positive is magenta', ValueConv => '$val > 128 ? $val - 256 : $val', @@ -3525,6 +3690,40 @@ my %faceInfo = ( PrintConv => '$val > 0 ? "+$val" : $val', PrintConvInv => '$val', }, + 0x08 => { #12 + Name => 'CustomWB_RGBLevels', + Format => 'int16u[3]', + }, + 0x0b => { #12 as set in WB "Custom" and in White Balance Bracketing + Name => 'ColorTemperatureCustom', + ValueConv => '$val * 100', + ValueConvInv => '$val / 100', + PrintConv => '"$val K"', + PrintConvInv => '$val =~ s/ ?K$//i; $val', + }, + 0x0c => { #12 as set in WB "Custom" + Name => 'ColorCompensationFilterCustom', + Notes => 'negative is green, positive is magenta', + ValueConv => '$val > 128 ? $val - 256 : $val', + ValueConvInv => '$val < 0 ? $val + 256 : $val', + PrintConv => '$val > 0 ? "+$val" : $val', + PrintConvInv => '$val', + }, + 0x0e => { #12 + Name => 'WhiteBalance', + PrintConv => { + 2 => 'Auto', + 4 => 'Daylight', + 5 => 'Fluorescent', + 6 => 'Tungsten', + 7 => 'Flash', + 12 => 'Color Temperature/Color Filter (12)', # seen on A700 + 13 => 'Color Temperature/Color Filter (13)', # seen on A700 - what is difference ? + 14 => 'Custom', + 16 => 'Cloudy', + 17 => 'Shade', + }, + }, 0x0f => { #12/PH (educated guess) Name => 'FocusModeSetting', PrintConv => { @@ -3563,6 +3762,15 @@ my %faceInfo = ( }, }, ### 0x12-0x18: subtract 2 from CameraSettings TagID + 0x12 => { #12 + Name => 'FlashExposureCompSet', + Description => 'Flash Exposure Comp. Setting', + # (as pre-selected by the user, not zero if flash didn't fire) + ValueConv => '($val - 128) / 24', #PH + ValueConvInv => 'int($val * 24 + 128.5)', + PrintConv => '$val ? sprintf("%+.1f",$val) : $val', + PrintConvInv => 'Image::ExifTool::Exif::ConvertFraction($val)', + }, 0x13 => { Name => 'MeteringMode', PrintConv => { @@ -3627,10 +3835,11 @@ my %faceInfo = ( }, ### 0x1c-0x24: subtract 4 from CameraSettings TagID (not sure about 0x1c) 0x1f => { #PH (educated guess) - Name => 'FlashMode', + Name => 'FlashControl', PrintConv => { 0 => 'ADI', - 1 => 'TTL', + 1 => 'Pre-flash TTL', + 2 => 'Manual', }, }, ### 0x25-0x27: subtract 6 from CameraSettings TagID @@ -3689,6 +3898,15 @@ my %faceInfo = ( Name => 'ImageStabilizationSetting', PrintConv => { 0 => 'Off', 1 => 'On' }, }, + 0x3e => { #12 + Name => 'FlashAction', + PrintConv => { + 0 => 'Did not fire', + 1 => 'Fired', + 2 => 'External Flash, Did not fire', + 3 => 'External Flash, Fired', + }, + }, 0x3f => { # (verified for A330/A380) Name => 'Rotation', PrintConv => { @@ -3697,6 +3915,26 @@ my %faceInfo = ( 2 => 'Rotate 270 CW', }, }, + 0x40 => { #12 + Name => 'AELock', + PrintConv => { + 1 => 'Off', + 2 => 'On', + }, + }, + 0x4c => { #12 + Name => 'FlashAction2', + PrintConv => { + 1 => 'Fired, Autoflash', + 2 => 'Fired, Fill-flash', + 3 => 'Fired, Rear Sync', + 4 => 'Fired, Wireless', + 5 => 'Did not fire', + 17 => 'Fired, Autoflash, Red-eye reduction', + 18 => 'Fired, Fill-flash, Red-eye reduction', + 34 => 'Fired, Fill-flash, HSS', + }, + }, 0x4d => { #12 Name => 'FocusMode', # (focus mode actually used) PrintConv => { @@ -3753,6 +3991,14 @@ my %faceInfo = ( }, }, ### 0x5a onwards: subtract 1 from CameraSettings TagID + # (0x69 not confirmed) + #0x69 => { #12 + # Name => 'RedEyeReduction', + # PrintConv => { + # 0 => 'Off', + # 1 => 'On', + # }, + #}, 0x7e => { #12 Name => 'DriveMode', Mask => 0xff, # (not sure what upper byte is for) @@ -6660,8 +6906,8 @@ my %exposureProgram2010 = ( # lens models: # 0.00: Unknown lenses/adapters # 1.00: Sigma DN, Tamron DiIII, Zeiss Touit, SEL18200LE - # 1.07 (Ver.01): Original E-lenses - # 1.08: LA-EA1, Metabones Smart + # 1.07 (Ver.01): Original E-lenses and LA-EA1 + # 1.08: LA-EA1 (Ver.02), Metabones Smart # 1.14: LA-EA2 # 1.20 (Ver.02): Newer or firmware-updated E-lenses, LA-EA3 # 1.30: LA-EA4 diff --git a/lib/Image/ExifTool/TagLookup.pm b/lib/Image/ExifTool/TagLookup.pm index 09761d58..68bf2c68 100644 --- a/lib/Image/ExifTool/TagLookup.pm +++ b/lib/Image/ExifTool/TagLookup.pm @@ -487,7 +487,7 @@ my %tagLookup = ( 'aeexposuretime' => { 265 => 0x0, 266 => 0x2, 267 => 0x10 }, 'aelbutton' => { 153 => 0x45 }, 'aelexposureindicator' => { 153 => 0x51 }, - 'aelock' => { 153 => 0x5b, 228 => '4.2', 234 => '4.2', 238 => 0x201, 291 => 0x48, 332 => [0x86,0x286] }, + 'aelock' => { 153 => 0x5b, 228 => '4.2', 234 => '4.2', 238 => 0x201, 291 => 0x48, 330 => 0x40, 331 => 0x40, 332 => [0x86,0x286] }, 'aelockbutton' => { 226 => '16.1', 228 => '4.1', 229 => '15.1', 230 => '16.1', 231 => '16.1', 232 => '30.1', 233 => '16.1', 234 => '4.1', 236 => '17.1' }, 'aelockbuttonplusdials' => { 226 => '16.2', 232 => '32.1' }, 'aelockformb-d80' => { 236 => '3.1' }, @@ -1058,7 +1058,8 @@ my %tagLookup = ( 'colorboosttype' => { 213 => 0x0 }, 'colorclass' => { 299 => 0xde, 300 => 'ColorClass' }, 'colorcompensationfilter' => { 153 => [0x3a,0x5f], 155 => 0x111, 342 => 0xb022 }, - 'colorcompensationfilterset' => { 330 => 0xd, 331 => 0xc, 332 => 0x18, 346 => 0xf }, + 'colorcompensationfiltercustom' => { 330 => 0xd, 331 => 0xc }, + 'colorcompensationfilterset' => { 330 => 0x8, 331 => 0x7, 332 => 0x18, 346 => 0xf }, 'colorcontrol' => { 243 => 0x102b }, 'colorcorrection' => { 369 => 0x8015 }, 'colordataversion' => { 36 => 0x0, 37 => 0x0, 39 => 0x0, 40 => 0x0 }, @@ -1099,8 +1100,10 @@ my %tagLookup = ( 'colortemperature' => { 6 => 0x73, 7 => [0x48,0x4e], 8 => 0xc0, 9 => 0x37, 10 => 0x62, 11 => 0x37, 12 => 0x7c, 13 => 0x73, 14 => 0x73, 15 => 0x77, 16 => 0x73, 17 => 0x7c, 18 => 0x58, 19 => 0x73, 20 => 0xc0, 21 => 0x7f, 22 => 0x7d, 23 => 0xc0, 24 => 0xc6, 25 => 0xc7, 26 => 0x7b, 53 => 0xae, 63 => 0x9, 84 => 0x10ae, 103 => 0x1005, 112 => 0x846, 128 => 'ColorTemperature', 151 => [0x6e,0x49], 152 => 0x3f, 153 => [0x39,0x5e], 155 => 0x10b, 158 => [0x3c,0x4c,0x4e], 254 => 0x321, 291 => 0x50, 313 => 0x1308, 342 => 0xb021, 383 => 'Temperature' }, 'colortemperatureadj' => { 369 => 0x8013 }, 'colortemperaturebg' => { 243 => 0x1013 }, + 'colortemperaturecustom' => { 330 => 0xc, 331 => 0xb }, 'colortemperaturerg' => { 243 => 0x1014 }, - 'colortemperaturesetting' => { 153 => 0x25, 330 => 0xc, 331 => 0xb, 332 => 0x17, 346 => 0xe }, + 'colortemperatureset' => { 330 => 0x7, 331 => 0x6 }, + 'colortemperaturesetting' => { 153 => 0x25, 332 => 0x17, 346 => 0xe }, 'colortempflash' => { 33 => 0x36, 34 => 0x40, 35 => 0x49, 36 => 0x70, 39 => 0x89, 40 => 0xa2, 291 => 0x5a }, 'colortempflashdata' => { 36 => 0x24a }, 'colortempfluorescent' => { 33 => 0x2c, 34 => 0x3b, 35 => 0x3f, 36 => 0x66, 39 => 0x7f, 40 => 0x98 }, @@ -1368,7 +1371,7 @@ my %tagLookup = ( 'customunsharpmaskstrength' => { 90 => 0xb6 }, 'customunsharpmaskthreshold' => { 90 => 0xba }, 'customwb_rblevels' => { 346 => 0x1a }, - 'customwb_rgblevels' => { 332 => 0x19 }, + 'customwb_rgblevels' => { 331 => 0x8, 332 => 0x19 }, 'customwbbluelevel' => { 153 => 0x36 }, 'customwberror' => { 153 => 0x37 }, 'customwbgreenlevel' => { 153 => 0x35 }, @@ -1692,7 +1695,7 @@ my %tagLookup = ( 'exposurecompensation' => { 65 => 0x6, 80 => 0x0, 98 => 0x9204, 114 => 0x24, 128 => 'ExposureComp', 150 => 0xd, 151 => 0x53, 152 => 0x1e, 156 => 0x49c0, 243 => 0x1006, 291 => 0x16, 319 => 0xa013, 322 => [0xc,0x35,0x4d], 349 => 0x114c, 350 => 0x114c, 351 => 0x1128, 353 => 0x1180, 354 => 0x1038, 355 => 0x230, 387 => 'ExposureBiasValue' }, 'exposurecompensation2' => { 346 => [0x24,0x26,0x2a] }, 'exposurecompensationmode' => { 153 => 0x47, 156 => 0x2a }, - 'exposurecompensationset' => { 332 => 0x3, 346 => 0x1e }, + 'exposurecompensationset' => { 330 => 0x3, 331 => 0x3, 332 => 0x3, 346 => 0x1e }, 'exposurecompensationsetting' => { 153 => 0x1 }, 'exposurecompstepsize' => { 226 => '6.3', 227 => '7.3', 232 => '4.3' }, 'exposurecontrolstep' => { 233 => '6.1' }, @@ -1880,8 +1883,8 @@ my %tagLookup = ( 'firstpublicationdate' => { 396 => 'FirstPublicationDate' }, 'fixtureidentifier' => { 106 => 0x16 }, 'flash' => { 95 => 'Flash', 98 => 0x9209, 151 => 0x1f, 152 => 0x15, 387 => 'Flash' }, - 'flashaction' => { 332 => [0x87,0x287] }, - 'flashaction2' => { 346 => [0x2a,0x2c,0x30] }, + 'flashaction' => { 330 => 0x3e, 331 => 0x3e, 332 => [0x87,0x287] }, + 'flashaction2' => { 330 => 0x4c, 331 => 0x4c, 346 => [0x2a,0x2c,0x30] }, 'flashactivity' => { 30 => 0x1c }, 'flashbatterylevel' => { 36 => 0x249 }, 'flashbias' => { 258 => 0x24 }, @@ -1891,7 +1894,7 @@ my %tagLookup = ( 'flashcolorfilter' => { 176 => 0x10 }, 'flashcommandermode' => { 174 => '9.1', 175 => '9.1', 176 => '9.1' }, 'flashcompensation' => { 174 => 0xa, 175 => 0xa, 176 => 0xa, 380 => 'FlashCompensation' }, - 'flashcontrol' => { 332 => 0x21 }, + 'flashcontrol' => { 330 => 0x23, 331 => 0x1f, 332 => 0x21 }, 'flashcontrolbuilt-in' => { 232 => '16.1', 233 => '23.1', 235 => '23.1' }, 'flashcontrolmode' => { 174 => '9.2', 175 => '9.2', 176 => '9.2', 238 => 0x404 }, 'flashcurtain' => { 258 => 0x48 }, @@ -1905,7 +1908,7 @@ my %tagLookup = ( 'flashexposurecomp3' => { 176 => 0x1d }, 'flashexposurecomp4' => { 176 => 0x27 }, 'flashexposurecomparea' => { 227 => '38.4' }, - 'flashexposurecompset' => { 153 => 0x10, 265 => 0xe, 332 => 0x23, 346 => 0x1f }, + 'flashexposurecompset' => { 153 => 0x10, 265 => 0xe, 330 => 0x14, 331 => 0x12, 332 => 0x23, 346 => 0x1f }, 'flashexposurecompset2' => { 346 => [0x26,0x2c] }, 'flashexposureindicator' => { 153 => 0x54 }, 'flashexposureindicatorlast' => { 153 => 0x56 }, @@ -1934,7 +1937,7 @@ my %tagLookup = ( 'flashmetering' => { 150 => 0x3f, 153 => 0x1c }, 'flashmeteringmode' => { 6 => 0x15, 12 => 0x15, 13 => 0x15, 14 => 0x15, 15 => 0x15, 16 => 0x15, 17 => 0x15, 19 => 0x15, 21 => 0x15, 26 => 0x15 }, 'flashmeteringsegments' => { 291 => 0x20a }, - 'flashmode' => { 93 => 0x4, 114 => 0x5c, 131 => 'Mode', 150 => 0x2, 151 => 0x20, 152 => 0x16, 153 => 0xf, 185 => 0x87, 238 => 0x400, 243 => 0x1004, 291 => 0xc, 297 => 0x4, 312 => 0x20, 313 => 0x100a, 321 => 0x225, 330 => 0x23, 331 => 0x1f, 332 => 0x20, 346 => 0x10, 387 => [\'Flash','FlashMode'] }, + 'flashmode' => { 93 => 0x4, 114 => 0x5c, 131 => 'Mode', 150 => 0x2, 151 => 0x20, 152 => 0x16, 153 => 0xf, 185 => 0x87, 238 => 0x400, 243 => 0x1004, 291 => 0xc, 297 => 0x4, 312 => 0x20, 313 => 0x100a, 321 => 0x225, 330 => 0x13, 332 => 0x20, 346 => 0x10, 387 => [\'Flash','FlashMode'] }, 'flashmodel' => { 131 => 'Model', 148 => 'FlashModel', 239 => 0x1001 }, 'flashoptions' => { 272 => 0x2 }, 'flashoptions2' => { 272 => 0x10 }, @@ -2216,7 +2219,7 @@ my %tagLookup = ( 'highlighttone' => { 103 => 0x1041 }, 'highlighttonepriority' => { 12 => 0x7, 15 => 0x7, 16 => 0x7, 17 => 0x7, 19 => 0x7, 21 => 0x7, 26 => 0x7, 52 => 0x3, 71 => 0x203 }, 'highlowkeyadj' => { 291 => 0x6c }, - 'highspeedsync' => { 153 => 0x5 }, + 'highspeedsync' => { 153 => 0x5, 330 => 0x2, 331 => 0x2 }, 'histogramxml' => { 219 => 0x83a1a25 }, 'history' => { 395 => 'History', 407 => 'History' }, 'historyaction' => { 407 => [\'History','HistoryAction'] }, @@ -3585,7 +3588,7 @@ my %tagLookup = ( 'redcurvepoints' => { 89 => 0x160 }, 'redeyecorrection' => { 223 => 0x0 }, 'redeyeinfo' => { 383 => 'RedEyeInfo' }, - 'redeyereduction' => { 153 => 0x41, 332 => 0x28 }, + 'redeyereduction' => { 153 => 0x41, 330 => 0x6a, 332 => 0x28 }, 'redhue' => { 383 => 'RedHue' }, 'redsaturation' => { 383 => 'RedSaturation' }, 'reductionmatrix1' => { 98 => 0xc625 }, @@ -4552,7 +4555,7 @@ my %tagLookup = ( 'wbtype6' => { 263 => 0x10, 264 => 0x15 }, 'wbtype7' => { 263 => 0x13, 264 => 0x19 }, 'webstatement' => { 410 => 'WebStatement' }, - 'whitebalance' => { 6 => 0x6f, 7 => [0x44,0x4a], 8 => 0xbc, 9 => 0x36, 10 => 0x5e, 11 => 0x36, 12 => 0x78, 13 => 0x6f, 14 => 0x6f, 15 => 0x73, 16 => 0x6f, 17 => 0x78, 18 => 0x54, 19 => 0x6f, 20 => 0xbc, 21 => 0x7b, 23 => 0xbc, 24 => 0xc2, 26 => 0x77, 63 => 0x8, 65 => 0x7, 93 => 0x7, 94 => [0x19,0x2012], 98 => [0xa403,0xfe4e], 103 => 0x1002, 112 => 0x3fc, 113 => 0xfa0d, 114 => 0x40, 150 => 0x3, 151 => 0xe, 152 => 0x4, 153 => 0xb, 155 => 0x115, 185 => 0x5, 209 => 0x7, 254 => 0x304, 258 => 0x3, 260 => 0x3033, 291 => 0x19, 297 => 0x7, 312 => 0x26, 313 => 0x1003, 322 => [0x3c,0x7,0x58], 342 => [0x115,0xb054], 383 => 'WhiteBalance', 387 => 'WhiteBalance' }, + 'whitebalance' => { 6 => 0x6f, 7 => [0x44,0x4a], 8 => 0xbc, 9 => 0x36, 10 => 0x5e, 11 => 0x36, 12 => 0x78, 13 => 0x6f, 14 => 0x6f, 15 => 0x73, 16 => 0x6f, 17 => 0x78, 18 => 0x54, 19 => 0x6f, 20 => 0xbc, 21 => 0x7b, 23 => 0xbc, 24 => 0xc2, 26 => 0x77, 63 => 0x8, 65 => 0x7, 93 => 0x7, 94 => [0x19,0x2012], 98 => [0xa403,0xfe4e], 103 => 0x1002, 112 => 0x3fc, 113 => 0xfa0d, 114 => 0x40, 150 => 0x3, 151 => 0xe, 152 => 0x4, 153 => 0xb, 155 => 0x115, 185 => 0x5, 209 => 0x7, 254 => 0x304, 258 => 0x3, 260 => 0x3033, 291 => 0x19, 297 => 0x7, 312 => 0x26, 313 => 0x1003, 322 => [0x3c,0x7,0x58], 330 => 0xf, 331 => 0xe, 342 => [0x115,0xb054], 383 => 'WhiteBalance', 387 => 'WhiteBalance' }, 'whitebalance2' => { 238 => 0x500 }, 'whitebalanceadj' => { 89 => 0x18, 219 => 0x76a43204 }, 'whitebalanceautoadjustment' => { 269 => 0x0 }, @@ -4561,11 +4564,11 @@ my %tagLookup = ( 'whitebalancebracket' => { 238 => 0x502, 243 => 0x303 }, 'whitebalancebracketing' => { 153 => 0x22, 156 => 0x2c, 341 => 0x2c }, 'whitebalancecomp' => { 246 => 0x1001 }, - 'whitebalancefinetune' => { 103 => 0x100a, 153 => 0x38, 155 => 0x112, 185 => 0xb, 313 => 0x1004, 330 => 0x6, 342 => 0x112 }, + 'whitebalancefinetune' => { 103 => 0x100a, 153 => 0x38, 155 => 0x112, 185 => 0xb, 313 => 0x1004, 330 => 0x6, 331 => 0x5, 342 => 0x112 }, 'whitebalancemode' => { 291 => 0x1a }, 'whitebalancered' => { 63 => 0x6 }, 'whitebalanceset' => { 272 => 0xa }, - 'whitebalancesetting' => { 153 => 0x23, 332 => 0x16, 346 => 0xd }, + 'whitebalancesetting' => { 153 => 0x23, 330 => 0x5, 331 => 0x4, 332 => 0x16, 346 => 0xd }, 'whitebalancetemperature' => { 238 => 0x501 }, 'whiteboard' => { 243 => 0x301 }, 'whitelevel' => { 98 => 0xc61d, 291 => 0x7e }, diff --git a/lib/Image/ExifTool/TagNames.pod b/lib/Image/ExifTool/TagNames.pod index a31706c7..c9723d48 100644 --- a/lib/Image/ExifTool/TagNames.pod +++ b/lib/Image/ExifTool/TagNames.pod @@ -12696,13 +12696,21 @@ Camera settings for the A200, A300, A350, A700, A850 and A900. ------ -------- -------- 0 ExposureTime int16u 1 FNumber int16u + 2 HighSpeedSync int16u + 3 ExposureCompensationSet int16u 4 DriveMode int16u & 0xff - 6 WhiteBalanceFineTune int16s - 12 ColorTemperatureSetting int16u - 13 ColorCompensationFilterSet int16u + 5 WhiteBalanceSetting int16u + 6 WhiteBalanceFineTune N + 7 ColorTemperatureSet int16u + 8 ColorCompensationFilterSet int16u + 12 ColorTemperatureCustom int16u + 13 ColorCompensationFilterCustom int16u + 15 WhiteBalance int16u 16 FocusModeSetting int16u 17 AFAreaMode int16u 18 AFPointSetting int16u + 19 FlashMode int16u + 20 FlashExposureCompSet int16u 21 MeteringMode int16u 22 ISOSetting int16u 24 DynamicRangeOptimizerMode int16u @@ -12714,7 +12722,7 @@ Camera settings for the A200, A300, A350, A700, A850 and A900. 30 Saturation int16u 31 ZoneMatchingValue int16u 34 Brightness int16u - 35 FlashMode int16u + 35 FlashControl int16u 40 PrioritySetupShutterRelease int16u 41 AFIlluminator int16u 42 AFWithShutter int16u @@ -12726,7 +12734,10 @@ Camera settings for the A200, A300, A350, A700, A850 and A900. 48 ApertureSetting int16u 60 ExposureProgram int16u 61 ImageStabilizationSetting int16u + 62 FlashAction int16u 63 Rotation int16u + 64 AELock int16u + 76 FlashAction2 int16u 77 FocusMode int16u 80 BatteryState int16u 81 BatteryLevel int16u @@ -12735,6 +12746,7 @@ Camera settings for the A200, A300, A350, A700, A850 and A900. 85 AspectRatio int16u 86 Quality int16u 88 ExposureLevelIncrements int16u + 106 RedEyeReduction int16u 154 FolderNumber int16u & 0x3ff 155 ImageNumber int16u & 0x3fff @@ -12746,11 +12758,20 @@ Camera settings for the A230, A290, A330, A380 and A390. ------ -------- -------- 0 ExposureTime int16u 1 FNumber int16u - 11 ColorTemperatureSetting int16u - 12 ColorCompensationFilterSet int16u + 2 HighSpeedSync int16u + 3 ExposureCompensationSet int16u + 4 WhiteBalanceSetting int16u + 5 WhiteBalanceFineTune N + 6 ColorTemperatureSet int16u + 7 ColorCompensationFilterSet int16u + 8 CustomWB_RGBLevels int16u[3] + 11 ColorTemperatureCustom int16u + 12 ColorCompensationFilterCustom int16u + 14 WhiteBalance int16u 15 FocusModeSetting int16u 16 AFAreaMode int16u 17 AFPointSetting int16u + 18 FlashExposureCompSet int16u 19 MeteringMode int16u 20 ISOSetting int16u 22 DynamicRangeOptimizerMode int16u @@ -12759,7 +12780,7 @@ Camera settings for the A230, A290, A330, A380 and A390. 25 Sharpness int16u 26 Contrast int16u 27 Saturation int16u - 31 FlashMode int16u + 31 FlashControl int16u 37 LongExposureNoiseReduction int16u 38 HighISONoiseReduction int16u 39 ImageStyle int16u @@ -12767,7 +12788,10 @@ Camera settings for the A230, A290, A330, A380 and A390. 41 ApertureSetting int16u 60 ExposureProgram int16u 61 ImageStabilizationSetting int16u + 62 FlashAction int16u 63 Rotation int16u + 64 AELock int16u + 76 FlashAction2 int16u 77 FocusMode int16u 83 FocusStatus int16u 84 SonyImageSize int16u diff --git a/lib/Image/ExifTool/Writer.pl b/lib/Image/ExifTool/Writer.pl index 2a923894..aa0f480e 100644 --- a/lib/Image/ExifTool/Writer.pl +++ b/lib/Image/ExifTool/Writer.pl @@ -1611,20 +1611,28 @@ sub SetFileModifyDate($$;$$$) if ($isOverwriting < 0) { # are we shifting time? # use original time of this file if not specified unless (defined $originalTime) { - $originalTime = ($tag eq 'FileCreateDate') ? -C $file : -M $file; + my ($aTime, $mTime, $cTime) = $self->GetFileTime($file); + $originalTime = ($tag eq 'FileCreateDate') ? $cTime : $mTime; return 0 unless defined $originalTime; - undef $isUnixTime; + $isUnixTime = 1; } $originalTime = int($^T - $originalTime*(24*3600) + 0.5) unless $isUnixTime; return 0 unless $self->IsOverwriting($nvHash, $originalTime); $val = $$nvHash{Value}[0]; # get shifted value } - if ($tag eq 'FileCreateDate') { - unless (eval { require Win32API::File::Time }) { - $self->Warn("Install Win32API::File::Time to set $tag"); - return -1; + if (not ref $file and $^O eq 'MSWin32' and eval { require Win32API::File::Time }) { + my $wfile = $file; + local ${^WIDE_SYSTEM_CALLS} = $self->EncodeFileName($wfile); + my ($aTime, $mTime, $cTime); + if ($tag eq 'FileCreateDate') { + $cTime = $val; + } else { + $aTime = $mTime = $val; } - $err = 1 unless Win32API::File::Time::SetFileTime($file,undef,undef,$val); + $err = 1 unless Win32API::File::Time::SetFileTime($wfile, $aTime, $mTime, $cTime); + } elsif ($tag eq 'FileCreateDate') { + $self->Warn("Install Win32API::File::Time to set $tag"); + return -1; } else { $err = 1 unless utime($val, $val, $file); } @@ -1738,9 +1746,14 @@ sub SetFileName($$;$$) return -1; } # preserve modification time - my $modTime = int($^T - (-M $file) * (24 * 3600) + 0.5); - my $accTime = int($^T - (-A $file) * (24 * 3600) + 0.5); - utime($accTime, $modTime, $newName); + my ($aTime, $mTime, $cTime) = $self->GetFileTime($file); + if ($^O eq 'MSWin32' and eval { require Win32API::File::Time }) { + my $wfile = $newName; + local ${^WIDE_SYSTEM_CALLS} = $self->EncodeFileName($wfile); + Win32API::File::Time::SetFileTime($wfile, $aTime, $mTime, $cTime); + } else { + utime($aTime, $mTime, $newName); + } # remove the original file $self->Unlink($file) or $self->Warn('Error removing old file'); } @@ -1775,15 +1788,18 @@ sub WriteInfo($$;$$) my ($nvHash, $nvHash2, $originalTime, $createTime); my $fileModifyDate = $self->GetNewValues('FileModifyDate', \$nvHash); my $fileCreateDate = $self->GetNewValues('FileCreateDate', \$nvHash2); + my ($aTime, $mTime, $cTime); if (defined $fileModifyDate and $self->IsOverwriting($nvHash) < 0 and defined $infile and ref $infile ne 'SCALAR') { - $originalTime = -M $infile; + ($aTime, $mTime, $cTime) = $self->GetFileTime($infile); + $originalTime = $mTime; } if (defined $fileCreateDate and $self->IsOverwriting($nvHash2) < 0 and defined $infile and ref $infile ne 'SCALAR') { - $createTime = -C $infile; + ($aTime, $mTime, $cTime) = $self->GetFileTime($infile) unless defined $cTime; + $createTime = $cTime; } # # do quick in-place change of file dir/name or date if that is all we are doing @@ -2195,11 +2211,15 @@ sub WriteInfo($$;$$) # set FileModifyDate if requested (and if possible!) if ($rtnVal > 0 and ($closeOut or ($closeIn and defined $outBuff))) { my $target = $closeOut ? $outfile : $infile; - if (defined $fileModifyDate and $self->SetFileModifyDate($target, $originalTime) > 0) { + if (defined $fileModifyDate and + $self->SetFileModifyDate($target, $originalTime, undef, 1) > 0) + { ++$$self{CHANGED}; # we changed something } # set FileCreateDate if requested (and if possible!) - if (defined $fileCreateDate and $self->SetFileModifyDate($target, $createTime, 'FileCreateDate')) { + if (defined $fileCreateDate and + $self->SetFileModifyDate($target, $createTime, 'FileCreateDate', 1)) + { ++$$self{CHANGED}; # we changed something } # create hard link if requested and no output filename specified (and if possible!) @@ -5754,15 +5774,35 @@ sub Unlink($@) while (@_) { my $file = shift; if ($self->EncodeFileName($file)) { - ++$result if Win32API::File::DeleteFileW($file); + ++$result if Win32API::File::DeleteFileW($file); } else { ++$result if unlink $file; } - } + } return $result; } #------------------------------------------------------------------------------ +# Get file times (Unix seconds since the epoch) +# Inputs: 0) ExifTool ref, 1) File name or ref +# Returns: 0) access time, 1) modification time, 2) creation time (or undefs on error) +sub GetFileTime($$) +{ + my ($self, $file) = @_; + my ($aTime, $mTime, $cTime); + if (not ref $file and $^O eq 'MSWin32' and eval { require Win32API::File::Time }) { + my $wfile = $file; + local ${^WIDE_SYSTEM_CALLS} = $self->EncodeFileName($wfile); + ($aTime, $mTime, $cTime) = Win32API::File::Time::GetFileTime($wfile); + } elsif (defined -M $file) { + $aTime = int($^T - (-A _) * (24 * 3600) + 0.5); + $mTime = int($^T - (-M _) * (24 * 3600) + 0.5); + $cTime = int($^T - (-C _) * (24 * 3600) + 0.5); + } + return($aTime, $mTime, $cTime); +} + +#------------------------------------------------------------------------------ # Copy data block from RAF to output file in max 64kB chunks # Inputs: 0) RAF ref, 1) outfile ref, 2) block size # Returns: 1 on success, 0 on read error, undef on write error |