exiftool-vendored.exe 12.99.0 → 13.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/exiftool.exe +0 -0
- package/bin/exiftool_files/exiftool.pl +183 -70
- package/bin/exiftool_files/lib/File/RandomAccess.pm +1 -1
- package/bin/exiftool_files/lib/File/RandomAccess.pod +2 -2
- package/bin/exiftool_files/lib/Image/ExifTool/AAC.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/AES.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/AFCP.pm +6 -6
- package/bin/exiftool_files/lib/Image/ExifTool/AIFF.pm +2 -2
- package/bin/exiftool_files/lib/Image/ExifTool/APE.pm +2 -2
- package/bin/exiftool_files/lib/Image/ExifTool/APP12.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/ASF.pm +2 -2
- package/bin/exiftool_files/lib/Image/ExifTool/Apple.pm +11 -9
- package/bin/exiftool_files/lib/Image/ExifTool/Audible.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/BMP.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/BPG.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/BZZ.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/BigTIFF.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/BuildTagLookup.pm +36 -22
- package/bin/exiftool_files/lib/Image/ExifTool/CBOR.pm +5 -2
- package/bin/exiftool_files/lib/Image/ExifTool/Canon.pm +66 -27
- package/bin/exiftool_files/lib/Image/ExifTool/CanonCustom.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/CanonRaw.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/CanonVRD.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/CaptureOne.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Casio.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Charset.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/DICOM.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/DJI.pm +196 -30
- package/bin/exiftool_files/lib/Image/ExifTool/DNG.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/DPX.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/DV.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/DarwinCore.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/DjVu.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/EXE.pm +138 -33
- package/bin/exiftool_files/lib/Image/ExifTool/Exif.pm +30 -17
- package/bin/exiftool_files/lib/Image/ExifTool/FITS.pm +3 -3
- package/bin/exiftool_files/lib/Image/ExifTool/FLAC.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/FLIF.pm +3 -3
- package/bin/exiftool_files/lib/Image/ExifTool/FLIR.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Fixup.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Flash.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/FlashPix.pm +17 -21
- package/bin/exiftool_files/lib/Image/ExifTool/Font.pm +2 -2
- package/bin/exiftool_files/lib/Image/ExifTool/FotoStation.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/FujiFilm.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/GE.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/GIF.pm +144 -93
- package/bin/exiftool_files/lib/Image/ExifTool/GIMP.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/GM.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/GPS.pm +34 -30
- package/bin/exiftool_files/lib/Image/ExifTool/GeoTiff.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Geolocation.dat +0 -0
- package/bin/exiftool_files/lib/Image/ExifTool/Geolocation.pm +19 -9
- package/bin/exiftool_files/lib/Image/ExifTool/Geotag.pm +49 -14
- package/bin/exiftool_files/lib/Image/ExifTool/GoPro.pm +120 -8
- package/bin/exiftool_files/lib/Image/ExifTool/H264.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/HP.pm +2 -2
- package/bin/exiftool_files/lib/Image/ExifTool/HTML.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/HtmlDump.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/ICC_Profile.pm +81 -2
- package/bin/exiftool_files/lib/Image/ExifTool/ICO.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/ID3.pm +8 -8
- package/bin/exiftool_files/lib/Image/ExifTool/IPTC.pm +10 -7
- package/bin/exiftool_files/lib/Image/ExifTool/ISO.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/ITC.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Import.pm +5 -4
- package/bin/exiftool_files/lib/Image/ExifTool/InDesign.pm +2 -2
- package/bin/exiftool_files/lib/Image/ExifTool/InfiRay.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/JPEG.pm +32 -5
- package/bin/exiftool_files/lib/Image/ExifTool/JPEGDigest.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/JSON.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/JVC.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Jpeg2000.pm +10 -9
- package/bin/exiftool_files/lib/Image/ExifTool/Kodak.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/KyoceraRaw.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/LIF.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/LNK.pm +2 -2
- package/bin/exiftool_files/lib/Image/ExifTool/Lang/cs.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Lang/de.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Lang/en_ca.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Lang/en_gb.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Lang/es.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Lang/fi.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Lang/fr.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Lang/it.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Lang/ja.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Lang/ko.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Lang/nl.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Lang/pl.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Lang/ru.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Lang/sk.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Lang/sv.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Lang/tr.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Lang/zh_cn.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Lang/zh_tw.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Leaf.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/LigoGPS.pm +409 -0
- package/bin/exiftool_files/lib/Image/ExifTool/Lytro.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/M2TS.pm +58 -19
- package/bin/exiftool_files/lib/Image/ExifTool/MIE.pm +15 -6
- package/bin/exiftool_files/lib/Image/ExifTool/MIEUnits.pod +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/MIFF.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/MISB.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/MNG.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/MOI.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/MPC.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/MPEG.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/MPF.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/MRC.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/MWG.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/MXF.pm +3 -3
- package/bin/exiftool_files/lib/Image/ExifTool/MacOS.pm +3 -2
- package/bin/exiftool_files/lib/Image/ExifTool/MakerNotes.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Matroska.pm +22 -6
- package/bin/exiftool_files/lib/Image/ExifTool/Microsoft.pm +2 -2
- package/bin/exiftool_files/lib/Image/ExifTool/Minolta.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/MinoltaRaw.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Motorola.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Nikon.pm +495 -39
- package/bin/exiftool_files/lib/Image/ExifTool/NikonCapture.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/NikonCustom.pm +2 -2
- package/bin/exiftool_files/lib/Image/ExifTool/NikonSettings.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Nintendo.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/OOXML.pm +8 -8
- package/bin/exiftool_files/lib/Image/ExifTool/Ogg.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Olympus.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/OpenEXR.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Opus.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Other.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/PCX.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/PDF.pm +49 -18
- package/bin/exiftool_files/lib/Image/ExifTool/PGF.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/PICT.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/PLIST.pm +4 -4
- package/bin/exiftool_files/lib/Image/ExifTool/PLUS.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/PNG.pm +20 -8
- package/bin/exiftool_files/lib/Image/ExifTool/PPM.pm +12 -3
- package/bin/exiftool_files/lib/Image/ExifTool/PSP.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Palm.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Panasonic.pm +27 -3
- package/bin/exiftool_files/lib/Image/ExifTool/PanasonicRaw.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Parrot.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Pentax.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/PhaseOne.pm +6 -5
- package/bin/exiftool_files/lib/Image/ExifTool/PhotoCD.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/PhotoMechanic.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Photoshop.pm +65 -4
- package/bin/exiftool_files/lib/Image/ExifTool/PostScript.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/PrintIM.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Protobuf.pm +270 -0
- package/bin/exiftool_files/lib/Image/ExifTool/Qualcomm.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/QuickTime.pm +326 -88
- package/bin/exiftool_files/lib/Image/ExifTool/QuickTimeStream.pl +266 -200
- package/bin/exiftool_files/lib/Image/ExifTool/README +12 -2
- package/bin/exiftool_files/lib/Image/ExifTool/RIFF.pm +21 -6
- package/bin/exiftool_files/lib/Image/ExifTool/RSRC.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/RTF.pm +2 -2
- package/bin/exiftool_files/lib/Image/ExifTool/Radiance.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Rawzor.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Real.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Reconyx.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Red.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Ricoh.pm +4 -4
- package/bin/exiftool_files/lib/Image/ExifTool/Samsung.pm +2 -2
- package/bin/exiftool_files/lib/Image/ExifTool/Sanyo.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Scalado.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Shift.pl +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Shortcuts.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Sigma.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/SigmaRaw.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Sony.pm +5 -4
- package/bin/exiftool_files/lib/Image/ExifTool/SonyIDC.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Stim.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/TagInfoXML.pm +6 -5
- package/bin/exiftool_files/lib/Image/ExifTool/TagLookup.pm +7025 -6967
- package/bin/exiftool_files/lib/Image/ExifTool/TagNames.pod +477 -46
- package/bin/exiftool_files/lib/Image/ExifTool/Text.pm +4 -3
- package/bin/exiftool_files/lib/Image/ExifTool/Theora.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Torrent.pm +3 -3
- package/bin/exiftool_files/lib/Image/ExifTool/Unknown.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/VCard.pm +3 -3
- package/bin/exiftool_files/lib/Image/ExifTool/Validate.pm +6 -6
- package/bin/exiftool_files/lib/Image/ExifTool/Vivo.pm +124 -0
- package/bin/exiftool_files/lib/Image/ExifTool/Vorbis.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/WPG.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/WTV.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/WriteCanonRaw.pl +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/WriteExif.pl +3 -3
- package/bin/exiftool_files/lib/Image/ExifTool/WriteIPTC.pl +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/WritePDF.pl +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/WritePNG.pl +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/WritePhotoshop.pl +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/WritePostScript.pl +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/WriteQuickTime.pl +166 -79
- package/bin/exiftool_files/lib/Image/ExifTool/WriteRIFF.pl +17 -6
- package/bin/exiftool_files/lib/Image/ExifTool/WriteXMP.pl +3 -3
- package/bin/exiftool_files/lib/Image/ExifTool/Writer.pl +89 -96
- package/bin/exiftool_files/lib/Image/ExifTool/XISF.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/XMP.pm +39 -14
- package/bin/exiftool_files/lib/Image/ExifTool/XMP2.pl +103 -1
- package/bin/exiftool_files/lib/Image/ExifTool/XMPStruct.pl +2 -3
- package/bin/exiftool_files/lib/Image/ExifTool/ZIP.pm +2 -2
- package/bin/exiftool_files/lib/Image/ExifTool/ZISRAW.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/iWork.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool.pm +338 -166
- package/bin/exiftool_files/lib/Image/ExifTool.pod +119 -73
- package/bin/exiftool_files/readme_windows.txt +8 -13
- package/bin/exiftool_files/windows_exiftool.txt +102 -53
- package/package.json +11 -11
package/bin/exiftool.exe
CHANGED
|
Binary file
|
|
@@ -11,7 +11,7 @@ use strict;
|
|
|
11
11
|
use warnings;
|
|
12
12
|
require 5.004;
|
|
13
13
|
|
|
14
|
-
my $version = '
|
|
14
|
+
my $version = '13.16';
|
|
15
15
|
|
|
16
16
|
# add our 'lib' directory to the include list BEFORE 'use Image::ExifTool'
|
|
17
17
|
my $exePath;
|
|
@@ -54,6 +54,7 @@ sub AddSetTagsFile($;$);
|
|
|
54
54
|
sub Warning($$);
|
|
55
55
|
sub DoSetFromFile($$$);
|
|
56
56
|
sub CleanFilename($);
|
|
57
|
+
sub HasWildcards($);
|
|
57
58
|
sub SetWindowTitle($);
|
|
58
59
|
sub ProcessFiles($;$);
|
|
59
60
|
sub ScanDir($$;$);
|
|
@@ -609,6 +610,10 @@ if (@Image::ExifTool::UserDefined::Arguments) {
|
|
|
609
610
|
unshift @ARGV, @Image::ExifTool::UserDefined::Arguments;
|
|
610
611
|
}
|
|
611
612
|
|
|
613
|
+
if ($version ne $Image::ExifTool::VERSION) {
|
|
614
|
+
Warn "Application version $version does not match Image::ExifTool library version $Image::ExifTool::VERSION\n";
|
|
615
|
+
}
|
|
616
|
+
|
|
612
617
|
# parse command-line options in 2 passes...
|
|
613
618
|
# pass 1: set all of our ExifTool options
|
|
614
619
|
# pass 2: print all of our help and informational output (-list, -ver, etc)
|
|
@@ -649,7 +654,7 @@ for (;;) {
|
|
|
649
654
|
}
|
|
650
655
|
# require MWG module if used in any argument
|
|
651
656
|
# (note: doesn't cover the -p option because these tags will be parsed on the 2nd pass)
|
|
652
|
-
$useMWG = 1 if not $useMWG and grep /^mwg:/i, @tags, @requestTags;
|
|
657
|
+
$useMWG = 1 if not $useMWG and grep /^([--_0-9A-Z]+:)*1?mwg:/i, @tags, @requestTags;
|
|
653
658
|
if ($useMWG) {
|
|
654
659
|
require Image::ExifTool::MWG;
|
|
655
660
|
Image::ExifTool::MWG::Load();
|
|
@@ -869,7 +874,7 @@ for (;;) {
|
|
|
869
874
|
} else {
|
|
870
875
|
print "Available API Options:\n";
|
|
871
876
|
my $availableOptions = Image::ExifTool::AvailableOptions();
|
|
872
|
-
printf(" %-17s - %s\n", $$_[0], $$_[2]) foreach @$availableOptions;
|
|
877
|
+
$$_[3] or printf(" %-17s - %s\n", $$_[0], $$_[2]) foreach @$availableOptions;
|
|
873
878
|
$helped = 1;
|
|
874
879
|
}
|
|
875
880
|
next;
|
|
@@ -1052,7 +1057,7 @@ for (;;) {
|
|
|
1052
1057
|
}
|
|
1053
1058
|
$trkfile or Error("Expecting file name for -geotag option\n"), $badCmd=1, next;
|
|
1054
1059
|
# allow wildcards in filename
|
|
1055
|
-
if ($trkfile
|
|
1060
|
+
if (HasWildcards($trkfile)) {
|
|
1056
1061
|
# CORE::glob() splits on white space, so use File::Glob if possible
|
|
1057
1062
|
my @trks;
|
|
1058
1063
|
if ($^O eq 'MSWin32' and eval { require Win32::FindFile }) {
|
|
@@ -1101,7 +1106,7 @@ for (;;) {
|
|
|
1101
1106
|
# prevent processing file unnecessarily for simple case of failed '$ok' or 'not $ok'
|
|
1102
1107
|
$cond =~ /^\s*(not\s*)\$ok\s*$/i and ($1 xor $rtnValPrev) and $failCondition=1;
|
|
1103
1108
|
# add to list of requested tags
|
|
1104
|
-
push @requestTags, $cond =~ /\$\{?((?:[
|
|
1109
|
+
push @requestTags, $cond =~ /\$\{?((?:[-_0-9A-Z]+:)*[-_0-9A-Z?*]+)/ig;
|
|
1105
1110
|
push @condition, $cond;
|
|
1106
1111
|
next;
|
|
1107
1112
|
}
|
|
@@ -1189,7 +1194,7 @@ for (;;) {
|
|
|
1189
1194
|
if ($pass) {
|
|
1190
1195
|
LoadPrintFormat($fmt, $1 || $binaryOutput);
|
|
1191
1196
|
# load MWG module now if necessary
|
|
1192
|
-
if (not $useMWG and grep /^mwg:/i, @requestTags) {
|
|
1197
|
+
if (not $useMWG and grep /^([-_0-9A-Z]+:)*1?mwg:/i, @requestTags) {
|
|
1193
1198
|
$useMWG = 1;
|
|
1194
1199
|
require Image::ExifTool::MWG;
|
|
1195
1200
|
Image::ExifTool::MWG::Load();
|
|
@@ -1388,11 +1393,11 @@ for (;;) {
|
|
|
1388
1393
|
push @newValues, { SaveCount => ++$saveCount };
|
|
1389
1394
|
}
|
|
1390
1395
|
push @newValues, $_;
|
|
1391
|
-
if (/^mwg:/i) {
|
|
1396
|
+
if (/^([-_0-9A-Z]+:)*1?mwg:/i) {
|
|
1392
1397
|
$useMWG = 1;
|
|
1393
|
-
} elsif (/^([
|
|
1398
|
+
} elsif (/^([-_0-9A-Z]+:)*(filename|directory|testname)\b/i) {
|
|
1394
1399
|
$doSetFileName = 1;
|
|
1395
|
-
} elsif (/^([
|
|
1400
|
+
} elsif (/^([-_0-9A-Z]+:)*(geotag|geotime|geosync|geolocate)\b/i) {
|
|
1396
1401
|
if (lc $2 eq 'geotime') {
|
|
1397
1402
|
$addGeotime = '';
|
|
1398
1403
|
} else {
|
|
@@ -1410,25 +1415,23 @@ for (;;) {
|
|
|
1410
1415
|
if ($setTagsFile) {
|
|
1411
1416
|
push @{$setTags{$setTagsFile}}, $_;
|
|
1412
1417
|
if ($1 eq '>') {
|
|
1413
|
-
$useMWG = 1 if /^(.*>\s*)?mwg:/si;
|
|
1418
|
+
$useMWG = 1 if /^(.*>\s*)?([-_0-9A-Z]+:)*1?mwg:/si;
|
|
1414
1419
|
if (/\b(filename|directory|testname)#?$/i) {
|
|
1415
1420
|
$doSetFileName = 1;
|
|
1416
1421
|
} elsif (/\bgeotime#?$/i) {
|
|
1417
1422
|
$addGeotime = '';
|
|
1418
1423
|
}
|
|
1419
1424
|
} else {
|
|
1420
|
-
$useMWG = 1 if /^([^<]+<\s*(.*\$\{?)?)?mwg:/si;
|
|
1421
|
-
if (/^([
|
|
1425
|
+
$useMWG = 1 if /^([^<]+<\s*(.*\$\{?)?)?([-_0-9A-Z]+:)*1?mwg:/si;
|
|
1426
|
+
if (/^([-_0-9A-Z]+:)*(filename|directory|testname)\b/i) {
|
|
1422
1427
|
$doSetFileName = 1;
|
|
1423
|
-
} elsif (/^([
|
|
1428
|
+
} elsif (/^([-_0-9A-Z]+:)*geotime\b/i) {
|
|
1424
1429
|
$addGeotime = '';
|
|
1425
1430
|
}
|
|
1426
1431
|
}
|
|
1427
1432
|
} else {
|
|
1428
1433
|
my $lst = s/^-// ? \@exclude : \@tags;
|
|
1429
|
-
unless
|
|
1430
|
-
Warn(qq(Invalid TAG name: "$_"\n));
|
|
1431
|
-
}
|
|
1434
|
+
Warn(qq(Invalid TAG name: "$_"\n)) unless /^([-_0-9A-Z*]+:)*([-_0-9A-Z*?]+)#?$/i;
|
|
1432
1435
|
push @$lst, $_; # (push everything for backward compatibility)
|
|
1433
1436
|
}
|
|
1434
1437
|
}
|
|
@@ -1438,7 +1441,7 @@ for (;;) {
|
|
|
1438
1441
|
push @nextPass, $_;
|
|
1439
1442
|
next;
|
|
1440
1443
|
}
|
|
1441
|
-
if ($doGlob and
|
|
1444
|
+
if ($doGlob and HasWildcards($_)) {
|
|
1442
1445
|
if ($^O eq 'MSWin32' and eval { require Win32::FindFile }) {
|
|
1443
1446
|
push @files, FindFileWindows($mt, $_);
|
|
1444
1447
|
} else {
|
|
@@ -1519,6 +1522,7 @@ if (($tagOut or defined $diff) and ($csv or $json or %printFmt or $tabFormat or
|
|
|
1519
1522
|
}
|
|
1520
1523
|
|
|
1521
1524
|
if ($csv and $csv eq 'CSV' and not $isWriting) {
|
|
1525
|
+
undef $json; # (not compatible)
|
|
1522
1526
|
if ($textOut) {
|
|
1523
1527
|
Warn "Sorry, -w may not be combined with -csv\n";
|
|
1524
1528
|
$rtnVal = 1;
|
|
@@ -1754,9 +1758,11 @@ if (@newValues) {
|
|
|
1754
1758
|
$wrn and Warning($mt, $wrn);
|
|
1755
1759
|
}
|
|
1756
1760
|
# exclude specified tags
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1761
|
+
unless ($csv) {
|
|
1762
|
+
foreach (@exclude) {
|
|
1763
|
+
$mt->SetNewValue($_, undef, Replace => 2);
|
|
1764
|
+
$needSave = 1;
|
|
1765
|
+
}
|
|
1760
1766
|
}
|
|
1761
1767
|
unless ($isWriting or $outOpt or @tags) {
|
|
1762
1768
|
Warn "Nothing to do.\n";
|
|
@@ -1772,7 +1778,7 @@ if ($isWriting) {
|
|
|
1772
1778
|
if (defined $diff) {
|
|
1773
1779
|
Error "Can't use -diff option when writing tags\n";
|
|
1774
1780
|
next;
|
|
1775
|
-
} elsif (@tags and not $outOpt) {
|
|
1781
|
+
} elsif (@tags and not $outOpt and not $csv) {
|
|
1776
1782
|
my ($tg, $s) = @tags > 1 ? ("$tags[0] ...", 's') : ($tags[0], '');
|
|
1777
1783
|
Warn "Ignored superfluous tag name$s or invalid option$s: -$tg\n";
|
|
1778
1784
|
}
|
|
@@ -1799,7 +1805,7 @@ if ($binaryOutput) {
|
|
|
1799
1805
|
}
|
|
1800
1806
|
|
|
1801
1807
|
# sort by groups to look nicer depending on options
|
|
1802
|
-
if (defined $showGroup and not (@tags and $allGroup) and ($sortOpt or not defined $sortOpt)) {
|
|
1808
|
+
if (defined $showGroup and not (@tags and ($allGroup or $csv)) and ($sortOpt or not defined $sortOpt)) {
|
|
1803
1809
|
$mt->Options(Sort => "Group$showGroup");
|
|
1804
1810
|
}
|
|
1805
1811
|
|
|
@@ -1837,7 +1843,7 @@ $altEnc = $mt->Options('Charset');
|
|
|
1837
1843
|
undef $altEnc if $altEnc eq 'UTF8';
|
|
1838
1844
|
|
|
1839
1845
|
# set flag to fix description lengths if necessary
|
|
1840
|
-
if (not $altEnc and $mt->Options('Lang') ne 'en'
|
|
1846
|
+
if (not $altEnc and $mt->Options('Lang') ne 'en') {
|
|
1841
1847
|
# (note that Unicode::GCString is part of the Unicode::LineBreak package)
|
|
1842
1848
|
$fixLen = eval { require Unicode::GCString } ? 2 : 1;
|
|
1843
1849
|
}
|
|
@@ -1909,7 +1915,7 @@ if (@dbKeys) {
|
|
|
1909
1915
|
print $vout "Imported entry for '${_}' (full path: '${absPath}')\n";
|
|
1910
1916
|
}
|
|
1911
1917
|
} elsif ($verbose and $verbose > 1) {
|
|
1912
|
-
print $vout "Imported entry for '${_}' (
|
|
1918
|
+
print $vout "Imported entry for '${_}' (no full path)\n";
|
|
1913
1919
|
}
|
|
1914
1920
|
}
|
|
1915
1921
|
}
|
|
@@ -2163,7 +2169,11 @@ sub GetImageInfo($$)
|
|
|
2163
2169
|
}
|
|
2164
2170
|
# can't make use of $info if verbose because we must reprocess
|
|
2165
2171
|
# the file anyway to generate the verbose output
|
|
2166
|
-
|
|
2172
|
+
# (also if writing just to avoid double-incrementing FileSequence)
|
|
2173
|
+
if ($isWriting or $verbose or defined $fastCondition or defined $diff) {
|
|
2174
|
+
undef $info;
|
|
2175
|
+
--$$et{FILE_SEQUENCE};
|
|
2176
|
+
}
|
|
2167
2177
|
} elsif ($file =~ s/^(\@JSON:)(.*)/$1/) {
|
|
2168
2178
|
# read JSON file from command line
|
|
2169
2179
|
my $dat = $2;
|
|
@@ -2283,6 +2293,10 @@ sub GetImageInfo($$)
|
|
|
2283
2293
|
$et->Options(Duplicates => 1, Sort => "Group$showGroup", Verbose => 0);
|
|
2284
2294
|
$et2 = Image::ExifTool->new;
|
|
2285
2295
|
$et2->Options(%{$$et{OPTIONS}});
|
|
2296
|
+
# must set list options specifically because they may have been
|
|
2297
|
+
# set incorrectly from deprecated List settings
|
|
2298
|
+
$et2->Options(ListSep => $$et{OPTIONS}{ListSep});
|
|
2299
|
+
$et2->Options(ListSplit => $$et{OPTIONS}{ListSplit});
|
|
2286
2300
|
@found2 = @foundTags;
|
|
2287
2301
|
$info2 = $et2->ImageInfo($file2, \@found2);
|
|
2288
2302
|
} else {
|
|
@@ -2339,14 +2353,15 @@ sub GetImageInfo($$)
|
|
|
2339
2353
|
|
|
2340
2354
|
# print differences if requested
|
|
2341
2355
|
if (defined $diff) {
|
|
2342
|
-
my (%done2, $wasDiff, @diffs, @groupTags2);
|
|
2356
|
+
my (%done, %done2, $wasDiff, @diffs, @groupTags2);
|
|
2343
2357
|
my $v = $verbose || 0;
|
|
2344
2358
|
print $fp "======== diff < $file > $file2\n";
|
|
2345
2359
|
my ($g2, $same) = (0, 0); # start with $g2 false, but not equal to '' to avoid infinite loop
|
|
2346
2360
|
for (;;) {
|
|
2361
|
+
my ($g, $tag2, $i, $key, @dupl, $val2, $t2, $equal, %used);
|
|
2347
2362
|
my $tag = shift @foundTags;
|
|
2348
|
-
my ($g, $tag2);
|
|
2349
2363
|
if (defined $tag) {
|
|
2364
|
+
$done{$tag} = 1;
|
|
2350
2365
|
$g = $et->GetGroup($tag, $showGroup);
|
|
2351
2366
|
} else {
|
|
2352
2367
|
for (;;) {
|
|
@@ -2356,7 +2371,6 @@ sub GetImageInfo($$)
|
|
|
2356
2371
|
}
|
|
2357
2372
|
}
|
|
2358
2373
|
if ($g ne $g2) {
|
|
2359
|
-
my $t2;
|
|
2360
2374
|
# add any outstanding tags from diff file not yet handled in previous group ($g2)
|
|
2361
2375
|
foreach $t2 (@groupTags2) {
|
|
2362
2376
|
next if $done2{$t2};
|
|
@@ -2375,7 +2389,7 @@ sub GetImageInfo($$)
|
|
|
2375
2389
|
$done2{$t2} = 1;
|
|
2376
2390
|
}
|
|
2377
2391
|
my $str = '';
|
|
2378
|
-
|
|
2392
|
+
$v and ($same or $v > 1) and $str = " ($same same tag" . ($same==1 ? '' : 's') . ')';
|
|
2379
2393
|
if (not $allGroup) {
|
|
2380
2394
|
print $fp "---- $g2 ----$str\n" if $g2 and ($str or @diffs);
|
|
2381
2395
|
} elsif ($str and $g2) {
|
|
@@ -2387,6 +2401,7 @@ sub GetImageInfo($$)
|
|
|
2387
2401
|
($g2, $same) = ($g, 0);
|
|
2388
2402
|
# build list of all tags in the new group of the diff file
|
|
2389
2403
|
@groupTags2 = ();
|
|
2404
|
+
push @groupTags2, $tag2 if defined $tag2;
|
|
2390
2405
|
foreach $t2 (@found2) {
|
|
2391
2406
|
$done2{$t2} or $g ne $et2->GetGroup($t2, $showGroup) or push @groupTags2, $t2;
|
|
2392
2407
|
}
|
|
@@ -2395,33 +2410,50 @@ sub GetImageInfo($$)
|
|
|
2395
2410
|
my $val = $et->GetValue($tag);
|
|
2396
2411
|
next unless defined $val; # (just in case)
|
|
2397
2412
|
my $name = GetTagName($tag);
|
|
2398
|
-
|
|
2413
|
+
my $desc = $outFormat < 1 ? $et->GetDescription($tag) : $name;
|
|
2414
|
+
# get matching tag key(s) from diff file
|
|
2399
2415
|
my @tags2 = grep /^$name( |$)/, @groupTags2;
|
|
2400
|
-
|
|
2401
|
-
my ($val2, $t2);
|
|
2402
|
-
foreach $t2 (@tags2) {
|
|
2416
|
+
T2: foreach $t2 (@tags2) {
|
|
2403
2417
|
next if $done2{$t2};
|
|
2404
2418
|
$tag2 = $t2;
|
|
2405
2419
|
$val2 = $et2->GetValue($t2);
|
|
2420
|
+
next unless defined $val2;
|
|
2421
|
+
IsEqual($val, $val2) and $equal = 1, last;
|
|
2422
|
+
# look ahead for upcoming duplicate tags in this group to see
|
|
2423
|
+
# if any would later match this value (and skip those for now)
|
|
2424
|
+
if ($$et{DUPL_TAG}{$name} and not @dupl) {
|
|
2425
|
+
for ($i=0, $key=$name; $i<=$$et{DUPL_TAG}{$name}; ++$i, $key="$name ($i)") {
|
|
2426
|
+
push @dupl, $key unless $done{$key} or $g ne $et->GetGroup($key, $showGroup);
|
|
2427
|
+
}
|
|
2428
|
+
@dupl = sort { $$et{FILE_ORDER}{$a} <=> $$et{FILE_ORDER}{$b} } @dupl if @dupl > 1;
|
|
2429
|
+
}
|
|
2430
|
+
foreach (@dupl) {
|
|
2431
|
+
next if $used{$_};
|
|
2432
|
+
my $v = $et->GetValue($_);
|
|
2433
|
+
next unless defined($v) and IsEqual($v, $val2);
|
|
2434
|
+
$used{$_} = 1; # would match this upcoming tag
|
|
2435
|
+
undef($tag2); undef($val2);
|
|
2436
|
+
next T2;
|
|
2437
|
+
}
|
|
2406
2438
|
last;
|
|
2407
2439
|
}
|
|
2408
|
-
if (
|
|
2440
|
+
if ($equal) {
|
|
2409
2441
|
++$same;
|
|
2410
2442
|
} else {
|
|
2411
|
-
my $len = LengthUTF8($
|
|
2443
|
+
my $len = LengthUTF8($desc);
|
|
2412
2444
|
my $pad = $outFormat < 2 ? ' ' x ($len < 32 ? 32 - $len : 0) : '';
|
|
2413
2445
|
if ($allGroup) {
|
|
2414
2446
|
my $grp = "[$g]";
|
|
2415
2447
|
$grp .= ' ' x (15 - length($grp)) if length($grp) < 15 and $outFormat < 2;
|
|
2416
|
-
push @diffs, sprintf "< %s %s%s: %s\n", $grp, $
|
|
2448
|
+
push @diffs, sprintf "< %s %s%s: %s\n", $grp, $desc, $pad, Printable($val);
|
|
2417
2449
|
if (defined $val2) {
|
|
2418
|
-
$
|
|
2419
|
-
push @diffs, sprintf "> %s %s%s: %s\n", $grp, $
|
|
2450
|
+
$grp = ' ' x length($grp), $desc = ' ' x $len if $v < 3;
|
|
2451
|
+
push @diffs, sprintf "> %s %s%s: %s\n", $grp, $desc, $pad, Printable($val2);
|
|
2420
2452
|
}
|
|
2421
2453
|
} else {
|
|
2422
|
-
push @diffs, sprintf "< %s%s: %s\n", $
|
|
2423
|
-
$
|
|
2424
|
-
push @diffs, sprintf "> %s%s
|
|
2454
|
+
push @diffs, sprintf "< %s%s: %s\n", $desc, $pad, Printable($val);
|
|
2455
|
+
$desc = ' ' x $len if $v < 3;
|
|
2456
|
+
push @diffs, sprintf "> %s%s: %s\n", $desc, $pad, Printable($val2) if defined $val2;
|
|
2425
2457
|
}
|
|
2426
2458
|
}
|
|
2427
2459
|
$done2{$tag2} = 1 if defined $tag2;
|
|
@@ -2618,7 +2650,13 @@ TAG: foreach $tag (@foundTags) {
|
|
|
2618
2650
|
# (note that the tag key may look like "TAG #(1)" when the "#" feature is used)
|
|
2619
2651
|
next if $noDups and $tag =~ /^(.*?) ?\(/ and defined $$info{$1} and
|
|
2620
2652
|
$group eq $et->GetGroup($1, $showGroup);
|
|
2621
|
-
|
|
2653
|
+
if (not $group and ($xml or $json or $csv)) {
|
|
2654
|
+
if ($showGroup !~ /\b4\b/) {
|
|
2655
|
+
$group = 'Unknown';
|
|
2656
|
+
} elsif ($json and not $allGroup) {
|
|
2657
|
+
$group = 'Copy0';
|
|
2658
|
+
}
|
|
2659
|
+
}
|
|
2622
2660
|
if ($fp and not ($allGroup or $csv)) {
|
|
2623
2661
|
if ($lastGroup ne $group) {
|
|
2624
2662
|
if ($html) {
|
|
@@ -2840,6 +2878,17 @@ TAG: foreach $tag (@foundTags) {
|
|
|
2840
2878
|
my $num = $et->GetValue($tag, 'ValueConv');
|
|
2841
2879
|
$$val{num} = $num if defined $num and not IsEqual($num, $$val{val});
|
|
2842
2880
|
}
|
|
2881
|
+
my $ex = $$et{TAG_EXTRA}{$tag};
|
|
2882
|
+
$$val{'fmt'} = $$ex{G6} if defined $$ex{G6};
|
|
2883
|
+
if (defined $$ex{BinVal}) {
|
|
2884
|
+
my $max = ($$et{OPTIONS}{LimitLongValues} - 5) / 3;
|
|
2885
|
+
if ($max >= 0 and length($$ex{BinVal}) > int($max)) {
|
|
2886
|
+
$max = int $max;
|
|
2887
|
+
$$val{'hex'} = join ' ', unpack("(H2)$max", $$ex{BinVal}), '[...]';
|
|
2888
|
+
} else {
|
|
2889
|
+
$$val{'hex'} = join ' ', unpack '(H2)*', $$ex{BinVal};
|
|
2890
|
+
}
|
|
2891
|
+
}
|
|
2843
2892
|
}
|
|
2844
2893
|
}
|
|
2845
2894
|
FormatJSON($fp, $val, $ind, $quote);
|
|
@@ -3117,7 +3166,7 @@ sub SetImageInfo($$$)
|
|
|
3117
3166
|
next;
|
|
3118
3167
|
} elsif (ref $dyFile eq 'SCALAR') {
|
|
3119
3168
|
# set new values from CSV or JSON database
|
|
3120
|
-
my ($f, $found, $
|
|
3169
|
+
my ($f, $found, $csvTag, $tryTag, $tg);
|
|
3121
3170
|
undef $evalWarning;
|
|
3122
3171
|
local $SIG{'__WARN__'} = sub { $evalWarning = $_[0] };
|
|
3123
3172
|
# force UTF-8 if the database was JSON
|
|
@@ -3134,10 +3183,44 @@ sub SetImageInfo($$$)
|
|
|
3134
3183
|
next unless defined $absPath and $csvInfo = $database{$absPath};
|
|
3135
3184
|
}
|
|
3136
3185
|
$found = 1;
|
|
3137
|
-
$verbose
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3186
|
+
if ($verbose) {
|
|
3187
|
+
print $vout "Setting new values from $csv database\n";
|
|
3188
|
+
print $vout 'Including tags: ',join(' ',@tags),"\n" if @tags;
|
|
3189
|
+
print $vout 'Excluding tags: ',join(' ',@exclude),"\n" if @exclude;
|
|
3190
|
+
}
|
|
3191
|
+
my @tryTags = (@exclude, @tags); # (exclude first because it takes priority)
|
|
3192
|
+
foreach (@tryTags) {
|
|
3193
|
+
tr/-0-9a-zA-Z_:#?*//dc; # remove illegal characters
|
|
3194
|
+
s/(^|:)(all:)+/$1/ig; # remove 'all' group names
|
|
3195
|
+
s/(^|:)all(#?)$/$1*$2/i; # convert 'all' tag name to '*'
|
|
3196
|
+
tr/?/./; s/\*/.*/g; # convert wildcards for regex
|
|
3197
|
+
}
|
|
3198
|
+
foreach $csvTag (OrderedKeys($csvInfo)) {
|
|
3199
|
+
# don't write SourceFile, Directory or FileName
|
|
3200
|
+
next if $csvTag =~ /^([-_0-9A-Z]+:)*(SourceFile|Directory|FileName)$/i;
|
|
3201
|
+
if (@tryTags) {
|
|
3202
|
+
my ($i, $tryGrp, $matched);
|
|
3203
|
+
TryMatch: for ($i=0; $i<@tryTags; ++$i) {
|
|
3204
|
+
$tryTag = $tryTags[$i];
|
|
3205
|
+
if ($tryTag =~ /:/) {
|
|
3206
|
+
next unless $csvTag =~ /:/; # db entry must also specify group
|
|
3207
|
+
my @csvGrps = split /:/, $csvTag;
|
|
3208
|
+
my @tryGrps = split /:/, $tryTag;
|
|
3209
|
+
my $tryName = pop @tryGrps;
|
|
3210
|
+
next unless pop(@csvGrps) =~ /^$tryName$/i; # tag name must match
|
|
3211
|
+
foreach $tryGrp (@tryGrps) {
|
|
3212
|
+
# each specified group name must match db entry
|
|
3213
|
+
next TryMatch unless grep /^$tryGrp$/i, @csvGrps;
|
|
3214
|
+
}
|
|
3215
|
+
$matched = 1;
|
|
3216
|
+
last;
|
|
3217
|
+
}
|
|
3218
|
+
# no group specified, so match by tag name only
|
|
3219
|
+
$csvTag =~ /^([-_0-9A-Z]+:)*$tryTag$/i and $matched = 1, last;
|
|
3220
|
+
}
|
|
3221
|
+
next if $matched ? $i < @exclude : @tags;
|
|
3222
|
+
}
|
|
3223
|
+
my ($rtn, $wrn) = $et->SetNewValue($csvTag, $$csvInfo{$csvTag},
|
|
3141
3224
|
Protected => 1, AddValue => $csvAdd,
|
|
3142
3225
|
ProtectSaved => $csvSaveCount);
|
|
3143
3226
|
$wrn and Warn "$wrn\n" if $verbose;
|
|
@@ -3604,7 +3687,7 @@ sub EscapeJSON($;$)
|
|
|
3604
3687
|
if ($json < 2) { # JSON
|
|
3605
3688
|
$str =~ tr/\0//d; # remove all nulls
|
|
3606
3689
|
# escape other control characters with \u
|
|
3607
|
-
$str =~ s/([\0-\x1f])/sprintf("\\u%.4X",ord $1)/sge;
|
|
3690
|
+
$str =~ s/([\0-\x1f\x7f])/sprintf("\\u%.4X",ord $1)/sge;
|
|
3608
3691
|
# JSON strings must be valid UTF8
|
|
3609
3692
|
Image::ExifTool::XMP::FixUTF8(\$str) unless $altEnc;
|
|
3610
3693
|
} else { # PHP
|
|
@@ -3612,7 +3695,7 @@ sub EscapeJSON($;$)
|
|
|
3612
3695
|
# must escape "$" too for PHP
|
|
3613
3696
|
$str =~ s/\$/\\\$/sg;
|
|
3614
3697
|
# escape other control characters with \x
|
|
3615
|
-
$str =~ s/([\0-\x1f])/sprintf("\\x%.2X",ord $1)/sge;
|
|
3698
|
+
$str =~ s/([\0-\x1f\x7f])/sprintf("\\x%.2X",ord $1)/sge;
|
|
3616
3699
|
}
|
|
3617
3700
|
return '"' . $str . '"'; # return the quoted string
|
|
3618
3701
|
}
|
|
@@ -3635,7 +3718,7 @@ sub FormatJSON($$$;$)
|
|
|
3635
3718
|
print $fp $bra;
|
|
3636
3719
|
foreach (@$val) {
|
|
3637
3720
|
print $fp ',' if $comma;
|
|
3638
|
-
FormatJSON($fp, $_, $ind);
|
|
3721
|
+
FormatJSON($fp, $_, $ind, $quote);
|
|
3639
3722
|
$comma = 1,
|
|
3640
3723
|
}
|
|
3641
3724
|
print $fp $ket,
|
|
@@ -3651,7 +3734,7 @@ sub FormatJSON($$$;$)
|
|
|
3651
3734
|
if ($showTagID and $_ eq 'id' and $showTagID eq 'H' and $$val{$_} =~ /^\d+\.\d+$/) {
|
|
3652
3735
|
print $fp qq{"$$val{$_}"};
|
|
3653
3736
|
} else {
|
|
3654
|
-
FormatJSON($fp, $$val{$_}, "$ind ");
|
|
3737
|
+
FormatJSON($fp, $$val{$_}, "$ind ", $quote);
|
|
3655
3738
|
}
|
|
3656
3739
|
$comma = 1,
|
|
3657
3740
|
}
|
|
@@ -3817,7 +3900,14 @@ sub Printable($)
|
|
|
3817
3900
|
$val = '(Binary data '.length($$val).' bytes)';
|
|
3818
3901
|
}
|
|
3819
3902
|
}
|
|
3820
|
-
$
|
|
3903
|
+
if ($escapeC) {
|
|
3904
|
+
$val =~ s/([\0-\x1f\\\x7f])/$escC{$1} || sprintf('\x%.2x', ord $1)/eg;
|
|
3905
|
+
} else {
|
|
3906
|
+
# translate unprintable chars in value and remove trailing spaces
|
|
3907
|
+
$val =~ tr/\x01-\x1f\x7f/./;
|
|
3908
|
+
$val =~ s/\x00//g;
|
|
3909
|
+
$val =~ s/\s+$//;
|
|
3910
|
+
}
|
|
3821
3911
|
return $val;
|
|
3822
3912
|
}
|
|
3823
3913
|
|
|
@@ -3828,17 +3918,23 @@ sub Printable($)
|
|
|
3828
3918
|
sub LengthUTF8($)
|
|
3829
3919
|
{
|
|
3830
3920
|
my $str = shift;
|
|
3921
|
+
return length $str unless $fixLen;
|
|
3922
|
+
local $SIG{'__WARN__'} = sub { };
|
|
3923
|
+
if (not $$mt{OPTIONS}{EncodeHangs} and eval { require Encode }) {
|
|
3924
|
+
$str = Encode::decode_utf8($str);
|
|
3925
|
+
} else {
|
|
3926
|
+
$str = pack('U0C*', unpack 'C*', $str);
|
|
3927
|
+
}
|
|
3831
3928
|
my $len;
|
|
3832
|
-
if (
|
|
3929
|
+
if ($fixLen == 1) {
|
|
3833
3930
|
$len = length $str;
|
|
3834
|
-
} elsif ($fixLen == 1) {
|
|
3835
|
-
$len = length Encode::decode_utf8($str);
|
|
3836
3931
|
} else {
|
|
3837
|
-
my $gcstr = eval { Unicode::GCString->new(
|
|
3932
|
+
my $gcstr = eval { Unicode::GCString->new($str) };
|
|
3838
3933
|
if ($gcstr) {
|
|
3839
3934
|
$len = $gcstr->columns;
|
|
3840
3935
|
} else {
|
|
3841
|
-
$len = length
|
|
3936
|
+
$len = length $str;
|
|
3937
|
+
delete $SIG{'__WARN__'};
|
|
3842
3938
|
Warning($mt, 'Unicode::GCString problem. Columns may be misaligned');
|
|
3843
3939
|
$fixLen = 1;
|
|
3844
3940
|
}
|
|
@@ -3941,6 +4037,19 @@ sub CleanFilename($)
|
|
|
3941
4037
|
$_[0] =~ tr/\\/\// if Image::ExifTool::IsPC();
|
|
3942
4038
|
}
|
|
3943
4039
|
|
|
4040
|
+
#------------------------------------------------------------------------------
|
|
4041
|
+
# Does path name contain wildcards
|
|
4042
|
+
# Inputs: 0) path name
|
|
4043
|
+
# Returns: true if path contains wildcards
|
|
4044
|
+
sub HasWildcards($)
|
|
4045
|
+
{
|
|
4046
|
+
my $path = shift;
|
|
4047
|
+
|
|
4048
|
+
# if this is a Windows path with the long path prefix, then wildcards are not supported
|
|
4049
|
+
return 0 if $^O eq 'MSWin32' and $path =~ m{^[\\/]{2}\?[\\/]};
|
|
4050
|
+
return $path =~ /[*?]/;
|
|
4051
|
+
}
|
|
4052
|
+
|
|
3944
4053
|
#------------------------------------------------------------------------------
|
|
3945
4054
|
# Check for valid UTF-8 of a file name
|
|
3946
4055
|
# Inputs: 0) string, 1) original encoding
|
|
@@ -4061,7 +4170,7 @@ sub ScanDir($$;$)
|
|
|
4061
4170
|
return if $ignore{$dir};
|
|
4062
4171
|
# use Win32::FindFile on Windows if available
|
|
4063
4172
|
# (ReadDir will croak if there is a wildcard, so check for this)
|
|
4064
|
-
if ($^O eq 'MSWin32' and $dir
|
|
4173
|
+
if ($^O eq 'MSWin32' and not HasWildcards($dir)) {
|
|
4065
4174
|
undef $evalWarning;
|
|
4066
4175
|
local $SIG{'__WARN__'} = sub { $evalWarning = $_[0] };;
|
|
4067
4176
|
if (CheckUTF8($dir, $enc) >= 0) {
|
|
@@ -4105,11 +4214,12 @@ sub ScanDir($$;$)
|
|
|
4105
4214
|
}
|
|
4106
4215
|
$dir =~ /\/$/ or $dir .= '/'; # make sure directory name ends with '/'
|
|
4107
4216
|
foreach $file (@fileList) {
|
|
4217
|
+
next if $file eq '.' or $file eq '..';
|
|
4108
4218
|
my $path = "$dir$file";
|
|
4109
4219
|
if ($et->IsDirectory($path)) {
|
|
4110
4220
|
next unless $recurse;
|
|
4111
4221
|
# ignore directories starting with "." by default
|
|
4112
|
-
next if $file =~ /^\./ and
|
|
4222
|
+
next if $file =~ /^\./ and $recurse == 1;
|
|
4113
4223
|
next if $ignore{$file} or ($ignore{SYMLINKS} and -l $path);
|
|
4114
4224
|
ScanDir($et, $path, $list);
|
|
4115
4225
|
last if $end;
|
|
@@ -4187,7 +4297,7 @@ sub FindFileWindows($$)
|
|
|
4187
4297
|
$wildfile = $et->Decode($wildfile, $enc, undef, 'UTF8') if $enc and $enc ne 'UTF8';
|
|
4188
4298
|
$wildfile =~ tr/\\/\//; # use forward slashes
|
|
4189
4299
|
my ($dir, $wildname) = ($wildfile =~ m{(.*[:/])(.*)}) ? ($1, $2) : ('', $wildfile);
|
|
4190
|
-
if ($dir
|
|
4300
|
+
if (HasWildcards($dir)) {
|
|
4191
4301
|
Warn "Wildcards don't work in the directory specification\n";
|
|
4192
4302
|
return ();
|
|
4193
4303
|
}
|
|
@@ -4257,14 +4367,15 @@ sub AbsPath($)
|
|
|
4257
4367
|
{
|
|
4258
4368
|
my $file = shift;
|
|
4259
4369
|
my $path;
|
|
4260
|
-
if (defined $file
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
$
|
|
4266
|
-
$path =
|
|
4370
|
+
if (defined $file) {
|
|
4371
|
+
return undef if $file eq '*'; # (CSV SourceFile may be '*' -- no absolute path for that)
|
|
4372
|
+
if ($^O eq 'MSWin32' and $mt->Options('WindowsLongPath')) {
|
|
4373
|
+
$path = $mt->WindowsLongPath($file);
|
|
4374
|
+
} elsif (eval { require Cwd }) {
|
|
4375
|
+
local $SIG{'__WARN__'} = sub { };
|
|
4376
|
+
$path = eval { Cwd::abs_path($file) };
|
|
4267
4377
|
}
|
|
4378
|
+
$path =~ tr/\\/\// if $^O eq 'MSWin32' and defined $path; # use forward slashes
|
|
4268
4379
|
}
|
|
4269
4380
|
return $path;
|
|
4270
4381
|
}
|
|
@@ -4299,7 +4410,7 @@ sub AddPrintFormat($)
|
|
|
4299
4410
|
$printFmt{$type} or $printFmt{$type} = [ ];
|
|
4300
4411
|
push @{$printFmt{$type}}, $expr;
|
|
4301
4412
|
# add to list of requested tags
|
|
4302
|
-
push @requestTags, $expr =~ /\$\{?((?:[
|
|
4413
|
+
push @requestTags, $expr =~ /\$\{?((?:[-_0-9A-Z]+:)*[-_0-9A-Z?*]+)/ig;
|
|
4303
4414
|
$printFmt{SetTags} = 1 if $expr =~ /\bSetTags\b/;
|
|
4304
4415
|
}
|
|
4305
4416
|
|
|
@@ -4654,7 +4765,7 @@ sub FilterArgfileLine($)
|
|
|
4654
4765
|
$arg =~ s/^\s+//; # remove leading white space
|
|
4655
4766
|
$arg =~ s/[\x0d\x0a]+$//s; # remove trailing newline
|
|
4656
4767
|
# remove white space before, and single space after '=', '+=', '-=' or '<='
|
|
4657
|
-
$arg =~ s/^(-[
|
|
4768
|
+
$arg =~ s/^(-[-_0-9A-Z:]+#?)\s*([-+<]?=) ?/$1$2/i;
|
|
4658
4769
|
return undef if $arg eq '';
|
|
4659
4770
|
}
|
|
4660
4771
|
return $arg;
|
|
@@ -4819,7 +4930,9 @@ sub Help()
|
|
|
4819
4930
|
my $docFile = "$Image::ExifTool::exeDir/exiftool_files/windows_exiftool.txt";
|
|
4820
4931
|
# try backslashes first if it seems we may be running in cmd.exe
|
|
4821
4932
|
$docFile =~ tr/\//\\/ if $ENV{ComSpec} or $docFile =~ /\\/;
|
|
4822
|
-
|
|
4933
|
+
# trap warnings and run in eval to avoid Perl bug which gives "Can't spawn" warning on ^C
|
|
4934
|
+
local $SIG{'__WARN__'} = sub { $evalWarning = $_[0] };
|
|
4935
|
+
eval { system(qq{more < "$docFile"}) };
|
|
4823
4936
|
}
|
|
4824
4937
|
|
|
4825
4938
|
# end
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
# Sets internal ERROR member from $! if there is an error reading
|
|
30
30
|
# the file.
|
|
31
31
|
#
|
|
32
|
-
# Legal: Copyright (c) 2003-
|
|
32
|
+
# Legal: Copyright (c) 2003-2025, Phil Harvey (philharvey66 at gmail.com)
|
|
33
33
|
# This library is free software; you can redistribute it and/or
|
|
34
34
|
# modify it under the same terms as Perl itself.
|
|
35
35
|
#------------------------------------------------------------------------------
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
#
|
|
4
4
|
# Description: Buffer to support random access reading of sequential file
|
|
5
5
|
#
|
|
6
|
-
# Legal: Copyright (c) 2003-
|
|
6
|
+
# Legal: Copyright (c) 2003-2025, Phil Harvey (philharvey66 at gmail.com)
|
|
7
7
|
# This library is free software; you can redistribute it and/or
|
|
8
8
|
# modify it under the same terms as Perl itself.
|
|
9
9
|
#------------------------------------------------------------------------------
|
|
@@ -236,7 +236,7 @@ the end of file is not allowed.
|
|
|
236
236
|
|
|
237
237
|
=head1 AUTHOR
|
|
238
238
|
|
|
239
|
-
Copyright 2003-
|
|
239
|
+
Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
|
|
240
240
|
|
|
241
241
|
This library is free software; you can redistribute it and/or modify it
|
|
242
242
|
under the same terms as Perl itself.
|
|
@@ -163,7 +163,7 @@ based on unofficial sources which may be incomplete, inaccurate or outdated.
|
|
|
163
163
|
|
|
164
164
|
=head1 AUTHOR
|
|
165
165
|
|
|
166
|
-
Copyright 2003-
|
|
166
|
+
Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
|
|
167
167
|
|
|
168
168
|
This library is free software; you can redistribute it and/or modify it
|
|
169
169
|
under the same terms as Perl itself.
|
|
@@ -477,7 +477,7 @@ main purpose of encryption, so this really can't be considered a bug.
|
|
|
477
477
|
|
|
478
478
|
=head1 AUTHOR
|
|
479
479
|
|
|
480
|
-
Copyright 2003-
|
|
480
|
+
Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
|
|
481
481
|
|
|
482
482
|
This library is free software; you can redistribute it and/or modify it
|
|
483
483
|
under the same terms as Perl itself.
|