exiftool-vendored.exe 13.0.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 +169 -65
- 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 +29 -16
- 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 +46 -12
- 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 +57 -18
- 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 +4 -4
- 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 +199 -195
- 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 +7023 -6968
- package/bin/exiftool_files/lib/Image/ExifTool/TagNames.pod +445 -29
- 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 +28 -13
- 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 +335 -163
- package/bin/exiftool_files/lib/Image/ExifTool.pod +119 -73
- package/bin/exiftool_files/windows_exiftool.txt +96 -51
- package/package.json +8 -8
|
@@ -20,7 +20,7 @@ use strict;
|
|
|
20
20
|
use vars qw($VERSION);
|
|
21
21
|
use Image::ExifTool qw(:DataAccess :Utils);
|
|
22
22
|
|
|
23
|
-
$VERSION = '1.
|
|
23
|
+
$VERSION = '1.21';
|
|
24
24
|
|
|
25
25
|
# road map of directory locations in GIF images
|
|
26
26
|
my %gifMap = (
|
|
@@ -28,6 +28,9 @@ my %gifMap = (
|
|
|
28
28
|
ICC_Profile => 'GIF',
|
|
29
29
|
);
|
|
30
30
|
|
|
31
|
+
# application extensions that we can write, and the order they are written
|
|
32
|
+
my @appExtensions = ( 'XMP Data/XMP', 'ICCRGBG1/012' );
|
|
33
|
+
|
|
31
34
|
%Image::ExifTool::GIF::Main = (
|
|
32
35
|
GROUPS => { 2 => 'Image' },
|
|
33
36
|
VARS => { NO_ID => 1 },
|
|
@@ -61,19 +64,26 @@ my %gifMap = (
|
|
|
61
64
|
%Image::ExifTool::GIF::Extensions = (
|
|
62
65
|
GROUPS => { 2 => 'Image' },
|
|
63
66
|
NOTES => 'Tags extracted from GIF89a application extensions.',
|
|
67
|
+
WRITE_PROC => sub { return 1 }, # (dummy proc to facilitate writable directories)
|
|
64
68
|
'NETSCAPE/2.0' => { #3
|
|
65
69
|
Name => 'Animation',
|
|
66
70
|
SubDirectory => { TagTable => 'Image::ExifTool::GIF::Animation' },
|
|
67
71
|
},
|
|
68
72
|
'XMP Data/XMP' => { #2
|
|
69
73
|
Name => 'XMP',
|
|
70
|
-
IncludeLengthBytes
|
|
71
|
-
|
|
74
|
+
# IncludeLengthBytes indicates the length bytes are part of the data value...
|
|
75
|
+
# undef = data may contain nulls and is split into 255-byte blocks
|
|
76
|
+
# 1 = data may not contain nulls and is not split; NULL padding is added as necessary
|
|
77
|
+
# 2 = data is not split and may be edited in place; 257-byte landing zone is added
|
|
78
|
+
# (Terminator may be specified for a value of 1 above, but must be specified for 2)
|
|
79
|
+
IncludeLengthBytes => 2,
|
|
80
|
+
Terminator => q(<\\?xpacket end=['"][wr]['"]\\?>), # (regex to match end of valid data)
|
|
81
|
+
Writable => 2, # (writable directory!)
|
|
72
82
|
SubDirectory => { TagTable => 'Image::ExifTool::XMP::Main' },
|
|
73
83
|
},
|
|
74
84
|
'ICCRGBG1/012' => { #4
|
|
75
85
|
Name => 'ICC_Profile',
|
|
76
|
-
Writable => 2,
|
|
86
|
+
Writable => 2, # (writable directory!)
|
|
77
87
|
SubDirectory => { TagTable => 'Image::ExifTool::ICC_Profile::Main' },
|
|
78
88
|
},
|
|
79
89
|
'MIDICTRL/Jon' => { #5
|
|
@@ -162,7 +172,7 @@ my %gifMap = (
|
|
|
162
172
|
);
|
|
163
173
|
|
|
164
174
|
#------------------------------------------------------------------------------
|
|
165
|
-
#
|
|
175
|
+
# Read/write meta information in GIF image
|
|
166
176
|
# Inputs: 0) ExifTool object reference, 1) Directory information ref
|
|
167
177
|
# Returns: 1 on success, 0 if this wasn't a valid GIF file, or -1 if
|
|
168
178
|
# an output file was specified and a write error occurred
|
|
@@ -174,7 +184,7 @@ sub ProcessGIF($$)
|
|
|
174
184
|
my $verbose = $et->Options('Verbose');
|
|
175
185
|
my $out = $et->Options('TextOut');
|
|
176
186
|
my ($a, $s, $ch, $length, $buff);
|
|
177
|
-
my ($err, $newComment, $setComment, $nvComment);
|
|
187
|
+
my ($err, $newComment, $setComment, $nvComment, $newExt);
|
|
178
188
|
my ($addDirs, %doneDir);
|
|
179
189
|
my ($frameCount, $delayTime) = (0, 0);
|
|
180
190
|
|
|
@@ -186,9 +196,19 @@ sub ProcessGIF($$)
|
|
|
186
196
|
my $ver = $1;
|
|
187
197
|
my $rtnVal = 0;
|
|
188
198
|
my $tagTablePtr = GetTagTable('Image::ExifTool::GIF::Main');
|
|
199
|
+
my $extTable = GetTagTable('Image::ExifTool::GIF::Extensions');
|
|
189
200
|
SetByteOrder('II');
|
|
190
201
|
|
|
191
202
|
if ($outfile) {
|
|
203
|
+
# add any user-defined writable app extensions to the list
|
|
204
|
+
my $ext;
|
|
205
|
+
foreach $ext (sort keys %$extTable) {
|
|
206
|
+
next unless ref $$extTable{$ext} eq 'HASH';
|
|
207
|
+
my $extInfo = $$extTable{$ext};
|
|
208
|
+
next unless $$extInfo{SubDirectory} and $$extInfo{Writable} and not $gifMap{$$extInfo{Name}};
|
|
209
|
+
$gifMap{$$extInfo{Name}} = 'GIF';
|
|
210
|
+
push @appExtensions, $ext;
|
|
211
|
+
}
|
|
192
212
|
$et->InitWriteDirs(\%gifMap, 'XMP'); # make XMP the preferred group for GIF
|
|
193
213
|
$addDirs = $$et{ADD_DIRS};
|
|
194
214
|
# determine if we are editing the File:Comment tag
|
|
@@ -196,8 +216,9 @@ sub ProcessGIF($$)
|
|
|
196
216
|
$newComment = $et->GetNewValue('Comment', \$nvComment);
|
|
197
217
|
$setComment = 1 if $nvComment or $$delGroup{File};
|
|
198
218
|
# change to GIF 89a if adding comment, XMP or ICC_Profile
|
|
199
|
-
$buff = 'GIF89a' if
|
|
219
|
+
$buff = 'GIF89a' if %$addDirs or defined $newComment;
|
|
200
220
|
Write($outfile, $buff, $s) or $err = 1;
|
|
221
|
+
$newExt = $et->GetNewTagInfoHash($extTable);
|
|
201
222
|
} else {
|
|
202
223
|
$et->SetFileType(); # set file type
|
|
203
224
|
$et->HandleTag($tagTablePtr, 'GIFVersion', $ver);
|
|
@@ -238,45 +259,50 @@ Block:
|
|
|
238
259
|
undef $nvComment; # delete any other extraneous comments
|
|
239
260
|
++$$et{CHANGED}; # increment file changed flag
|
|
240
261
|
}
|
|
241
|
-
# add application
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
my $
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
262
|
+
# add application extensions if necessary
|
|
263
|
+
my $ext;
|
|
264
|
+
my @new = sort keys %$newExt;
|
|
265
|
+
foreach $ext (@appExtensions, @new) {
|
|
266
|
+
my $extInfo = $$extTable{$ext};
|
|
267
|
+
my $name = $$extInfo{Name};
|
|
268
|
+
if ($$newExt{$ext}) {
|
|
269
|
+
delete $$newExt{$ext};
|
|
270
|
+
$doneDir{$name} = 1; # (we wrote this as a block instead)
|
|
271
|
+
$buff = $et->GetNewValue($extInfo);
|
|
272
|
+
$et->VerboseValue("+ GIF:$name", $buff);
|
|
273
|
+
} elsif (exists $$addDirs{$name} and not defined $doneDir{$name}) {
|
|
274
|
+
$doneDir{$name} = 1;
|
|
275
|
+
my $tbl = GetTagTable($$extInfo{SubDirectory}{TagTable});
|
|
276
|
+
my %dirInfo = ( Parent => 'GIF' );
|
|
277
|
+
$verbose and print $out "Creating $name application extension block:\n";
|
|
278
|
+
$buff = $et->WriteDirectory(\%dirInfo, $tbl);
|
|
254
279
|
} else {
|
|
255
|
-
|
|
280
|
+
next;
|
|
256
281
|
}
|
|
257
|
-
}
|
|
258
|
-
# add application extension containing ICC_Profile if necessary
|
|
259
|
-
if (exists $$addDirs{ICC_Profile} and not defined $doneDir{ICC_Profile}) {
|
|
260
|
-
$doneDir{ICC_Profile} = 1;
|
|
261
|
-
# write new ICC_Profile
|
|
262
|
-
my $iccTable = GetTagTable('Image::ExifTool::ICC_Profile::Main');
|
|
263
|
-
my %dirInfo = ( Parent => 'GIF' );
|
|
264
|
-
$verbose and print $out "Creating ICC_Profile application extension block:\n";
|
|
265
|
-
$buff = $et->WriteDirectory(\%dirInfo, $iccTable);
|
|
266
282
|
if (defined $buff and length $buff) {
|
|
283
|
+
++$$et{CHANGED};
|
|
284
|
+
Write($outfile, "\x21\xff\x0b", substr($ext,0,8), substr($ext,9,3)) or $err = 1;
|
|
267
285
|
my $pos = 0;
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
286
|
+
if (not $$extTable{$ext}{IncludeLengthBytes}) {
|
|
287
|
+
my $len = length $buff;
|
|
288
|
+
while ($pos < length $buff) {
|
|
289
|
+
my $n = length($buff) - $pos;
|
|
290
|
+
$n = 255 if $n > 255;
|
|
291
|
+
Write($outfile, chr($n), substr($buff, $pos, $n)) or $err = 1;
|
|
292
|
+
$pos += $n;
|
|
293
|
+
}
|
|
294
|
+
Write($outfile, "\0") or $err = 1; # write null terminator
|
|
295
|
+
} elsif ($$extTable{$ext}{IncludeLengthBytes} < 2) {
|
|
296
|
+
$pos += ord(substr($buff,$pos,1)) + 1 while $pos < length $buff;
|
|
297
|
+
# write data, null padding and terminator
|
|
298
|
+
Write($outfile, $buff, "\0" x ($pos - length($buff) + 1)) or $err = 1;
|
|
299
|
+
} else {
|
|
300
|
+
# write data, landing zone and null terminator
|
|
301
|
+
Write($outfile, $buff, pack('C*',1,reverse(0..255),0)) or $err = 1;
|
|
275
302
|
}
|
|
276
|
-
|
|
277
|
-
++$doneDir{ICC_Profile}; # set to 2 to indicate we added a new profile
|
|
303
|
+
++$doneDir{$name}; # set to 2 to indicate we added it
|
|
278
304
|
} else {
|
|
279
|
-
$verbose and print $out " -> no
|
|
305
|
+
$verbose and print $out " -> no $name to add\n";
|
|
280
306
|
}
|
|
281
307
|
}
|
|
282
308
|
}
|
|
@@ -286,7 +312,7 @@ Block:
|
|
|
286
312
|
# image descriptor
|
|
287
313
|
last unless $raf->Read($buff, 8) == 8 and $raf->Read($ch, 1);
|
|
288
314
|
Write($outfile, $buff, $ch) or $err = 1 if $outfile;
|
|
289
|
-
if ($verbose) {
|
|
315
|
+
if ($verbose and not $outfile) {
|
|
290
316
|
my ($left, $top, $w, $h) = unpack('v*', $buff);
|
|
291
317
|
print $out "Image: left=$left top=$top width=$w height=$h\n";
|
|
292
318
|
}
|
|
@@ -352,9 +378,9 @@ Block:
|
|
|
352
378
|
}
|
|
353
379
|
if ($isOverwriting) {
|
|
354
380
|
++$$et{CHANGED}; # increment file changed flag
|
|
355
|
-
$et->VerboseValue('- Comment', $comment);
|
|
381
|
+
$et->VerboseValue('- GIF:Comment', $comment);
|
|
356
382
|
$comment = $newComment;
|
|
357
|
-
$et->VerboseValue('+ Comment', $comment) if defined $comment;
|
|
383
|
+
$et->VerboseValue('+ GIF:Comment', $comment) if defined $comment;
|
|
358
384
|
undef $nvComment; # just delete remaining comments
|
|
359
385
|
} else {
|
|
360
386
|
undef $setComment; # leave remaining comments alone
|
|
@@ -393,14 +419,19 @@ Block:
|
|
|
393
419
|
$tag =~ tr/\0-\x1f//d; # remove nulls and control characters
|
|
394
420
|
$verbose and print $out "Application Extension: $tag\n";
|
|
395
421
|
|
|
396
|
-
my $extTable = GetTagTable('Image::ExifTool::GIF::Extensions');
|
|
397
422
|
my $extInfo = $$extTable{$tag};
|
|
398
|
-
my ($subdir, $inclLen, $justCopy);
|
|
423
|
+
my ($subdir, $inclLen, $justCopy, $name);
|
|
399
424
|
if ($extInfo) {
|
|
400
|
-
$
|
|
425
|
+
if ($outfile and $$newExt{$$extInfo{TagID}}) {
|
|
426
|
+
delete $$newExt{$$extInfo{TagID}}; # don't create again
|
|
427
|
+
# (write as a block -- don't define $subdir)
|
|
428
|
+
} else {
|
|
429
|
+
$subdir = $$extInfo{SubDirectory};
|
|
430
|
+
}
|
|
401
431
|
$inclLen = $$extInfo{IncludeLengthBytes};
|
|
402
|
-
|
|
403
|
-
|
|
432
|
+
$name = $$extInfo{Name};
|
|
433
|
+
# rewrite as-is unless this is a writable
|
|
434
|
+
$justCopy = 1 if $outfile and not $$extInfo{Writable};
|
|
404
435
|
} else {
|
|
405
436
|
$justCopy = 1 if $outfile;
|
|
406
437
|
}
|
|
@@ -415,62 +446,82 @@ Block:
|
|
|
415
446
|
Write($outfile, $ch, $buff) or $err = 1 if $justCopy;
|
|
416
447
|
$dat .= $inclLen ? $ch . $buff : $buff;
|
|
417
448
|
}
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
if ($
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
$
|
|
449
|
+
if ($justCopy) {
|
|
450
|
+
Write($outfile, "\0") or $err = 1;
|
|
451
|
+
next;
|
|
452
|
+
} elsif ($inclLen) {
|
|
453
|
+
# remove landing zone or padding
|
|
454
|
+
if ($$extInfo{Terminator} and $dat =~ /$$extInfo{Terminator}/g) {
|
|
455
|
+
$dat = substr($dat, 0, pos($dat));
|
|
456
|
+
} elsif ($dat =~ /\0/g) {
|
|
457
|
+
$dat = substr($dat, 0, pos($dat) - 1);
|
|
427
458
|
}
|
|
459
|
+
}
|
|
460
|
+
if ($subdir) {
|
|
428
461
|
my %dirInfo = (
|
|
429
462
|
DataPt => \$dat,
|
|
430
463
|
DataLen => length $dat,
|
|
431
|
-
DirLen => $
|
|
464
|
+
DirLen => length $dat,
|
|
432
465
|
DirName => $name,
|
|
433
466
|
Parent => 'GIF',
|
|
434
467
|
);
|
|
435
468
|
my $subTable = GetTagTable($$subdir{TagTable});
|
|
436
|
-
|
|
469
|
+
unless ($outfile) {
|
|
437
470
|
$et->ProcessDirectory(\%dirInfo, $subTable);
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
$
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
my $pos = 0;
|
|
461
|
-
my $len = length $dat;
|
|
462
|
-
while ($pos < $len) {
|
|
463
|
-
my $n = $len - $pos;
|
|
464
|
-
$n = 255 if $n > 255;
|
|
465
|
-
Write($outfile, chr($n), substr($dat, $pos, $n)) or $err = 1;
|
|
466
|
-
$pos += $n;
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
Write($outfile, "\0") or $err = 1; # write null terminator
|
|
471
|
+
next;
|
|
472
|
+
}
|
|
473
|
+
next if $justCopy;
|
|
474
|
+
if ($doneDir{$name} and $doneDir{$name} > 1) {
|
|
475
|
+
$et->Warn("Duplicate $name block created");
|
|
476
|
+
}
|
|
477
|
+
$buff = $et->WriteDirectory(\%dirInfo, $subTable);
|
|
478
|
+
if (defined $buff) {
|
|
479
|
+
next unless length $buff; # delete this extension if length is zero
|
|
480
|
+
$dat = $buff;
|
|
481
|
+
}
|
|
482
|
+
$doneDir{$name} = 1;
|
|
483
|
+
} elsif ($outfile and not $justCopy) {
|
|
484
|
+
my $nvHash = $et->GetNewValueHash($extInfo);
|
|
485
|
+
if ($nvHash and $et->IsOverwriting($nvHash, $dat)) {
|
|
486
|
+
++$$et{CHANGED};
|
|
487
|
+
my $val = $et->GetNewValue($extInfo);
|
|
488
|
+
$et->VerboseValue("- GIF:$name", $dat);
|
|
489
|
+
next unless defined $val and length $val;
|
|
490
|
+
$dat = $val;
|
|
491
|
+
$et->VerboseValue("+ GIF:$name", $dat);
|
|
492
|
+
$doneDir{$name} = 1; # (possibly wrote dir as a block)
|
|
470
493
|
}
|
|
471
494
|
} elsif (not $outfile) {
|
|
472
495
|
$et->HandleTag($extTable, $tag, $dat);
|
|
496
|
+
next;
|
|
497
|
+
}
|
|
498
|
+
Write($outfile, $hdr) or $err = 1; # write extension header
|
|
499
|
+
if ($inclLen) {
|
|
500
|
+
# check for null just to be safe
|
|
501
|
+
$et->Error("$name contained NULL character") if $inclLen and $dat =~ /\0/;
|
|
502
|
+
if ($inclLen > 1) {
|
|
503
|
+
# add landing zone (without terminator, which will be added later)
|
|
504
|
+
$dat .= pack('C*',1,reverse(0..255)) if $inclLen;
|
|
505
|
+
} else {
|
|
506
|
+
# pad with nulls as required
|
|
507
|
+
my $pos = 0;
|
|
508
|
+
$pos += ord(substr($dat,$pos,1)) + 1 while $pos < length $dat;
|
|
509
|
+
$dat .= "\0" x ($pos - length($dat));
|
|
510
|
+
}
|
|
511
|
+
# write data and landing zone
|
|
512
|
+
Write($outfile, $dat) or $err = 1;
|
|
513
|
+
} else {
|
|
514
|
+
# write as sub-blocks
|
|
515
|
+
my $pos = 0;
|
|
516
|
+
my $len = length $dat;
|
|
517
|
+
while ($pos < $len) {
|
|
518
|
+
my $n = $len - $pos;
|
|
519
|
+
$n = 255 if $n > 255;
|
|
520
|
+
Write($outfile, chr($n), substr($dat, $pos, $n)) or $err = 1;
|
|
521
|
+
$pos += $n;
|
|
522
|
+
}
|
|
473
523
|
}
|
|
524
|
+
Write($outfile, "\0") or $err = 1; # write null terminator
|
|
474
525
|
next;
|
|
475
526
|
|
|
476
527
|
} elsif ($a == 0xf9 and $length == 4) { # graphic control extension
|
|
@@ -489,7 +540,7 @@ Block:
|
|
|
489
540
|
|
|
490
541
|
last unless $raf->Read($buff, $length) == $length;
|
|
491
542
|
Write($outfile, $ch, $s, $buff) or $err = 1 if $outfile;
|
|
492
|
-
if ($verbose) {
|
|
543
|
+
if ($verbose and not $outfile) {
|
|
493
544
|
my ($left, $top, $w, $h) = unpack('v4', $buff);
|
|
494
545
|
print $out "Text: left=$left top=$top width=$w height=$h\n";
|
|
495
546
|
}
|
|
@@ -545,7 +596,7 @@ write GIF meta information.
|
|
|
545
596
|
|
|
546
597
|
=head1 AUTHOR
|
|
547
598
|
|
|
548
|
-
Copyright 2003-
|
|
599
|
+
Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
|
|
549
600
|
|
|
550
601
|
This library is free software; you can redistribute it and/or modify it
|
|
551
602
|
under the same terms as Perl itself.
|
|
@@ -270,7 +270,7 @@ GIMP software.
|
|
|
270
270
|
|
|
271
271
|
=head1 AUTHOR
|
|
272
272
|
|
|
273
|
-
Copyright 2003-
|
|
273
|
+
Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
|
|
274
274
|
|
|
275
275
|
This library is free software; you can redistribute it and/or modify it
|
|
276
276
|
under the same terms as Perl itself.
|
|
@@ -531,7 +531,7 @@ metadata from videos written by some GM models such as Corvette and Camero.
|
|
|
531
531
|
|
|
532
532
|
=head1 AUTHOR
|
|
533
533
|
|
|
534
|
-
Copyright 2003-
|
|
534
|
+
Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
|
|
535
535
|
|
|
536
536
|
This library is free software; you can redistribute it and/or modify it
|
|
537
537
|
under the same terms as Perl itself.
|
|
@@ -12,7 +12,7 @@ use strict;
|
|
|
12
12
|
use vars qw($VERSION);
|
|
13
13
|
use Image::ExifTool::Exif;
|
|
14
14
|
|
|
15
|
-
$VERSION = '1.
|
|
15
|
+
$VERSION = '1.57';
|
|
16
16
|
|
|
17
17
|
my %coordConv = (
|
|
18
18
|
ValueConv => 'Image::ExifTool::GPS::ToDegrees($val)',
|
|
@@ -20,6 +20,34 @@ my %coordConv = (
|
|
|
20
20
|
PrintConv => 'Image::ExifTool::GPS::ToDMS($self, $val, 1)',
|
|
21
21
|
);
|
|
22
22
|
|
|
23
|
+
my %printConvLatRef = (
|
|
24
|
+
# extract N/S if written from Composite:GPSLatitude
|
|
25
|
+
# (also allow writing from a signed number)
|
|
26
|
+
OTHER => sub {
|
|
27
|
+
my ($val, $inv) = @_;
|
|
28
|
+
return undef unless $inv;
|
|
29
|
+
return uc $2 if $val =~ /(^|[^A-Z])([NS])(orth|outh)?\b/i;
|
|
30
|
+
return $1 eq '-' ? 'S' : 'N' if $val =~ /([-+]?)\d+/;
|
|
31
|
+
return undef;
|
|
32
|
+
},
|
|
33
|
+
N => 'North',
|
|
34
|
+
S => 'South',
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
my %printConvLonRef = (
|
|
38
|
+
# extract E/W if written from Composite:GPSLongitude
|
|
39
|
+
# (also allow writing from a signed number)
|
|
40
|
+
OTHER => sub {
|
|
41
|
+
my ($val, $inv) = @_;
|
|
42
|
+
return undef unless $inv;
|
|
43
|
+
return uc $2 if $val =~ /(^|[^A-Z])([EW])(ast|est)?\b/i;
|
|
44
|
+
return $1 eq '-' ? 'W' : 'E' if $val =~ /([-+]?)\d+/;
|
|
45
|
+
return undef;
|
|
46
|
+
},
|
|
47
|
+
E => 'East',
|
|
48
|
+
W => 'West',
|
|
49
|
+
);
|
|
50
|
+
|
|
23
51
|
%Image::ExifTool::GPS::Main = (
|
|
24
52
|
GROUPS => { 0 => 'EXIF', 1 => 'GPS', 2 => 'Location' },
|
|
25
53
|
WRITE_PROC => \&Image::ExifTool::Exif::WriteExif,
|
|
@@ -43,19 +71,7 @@ my %coordConv = (
|
|
|
43
71
|
latitudes or negative for south, or a string containing N, North, S or South
|
|
44
72
|
},
|
|
45
73
|
Count => 2,
|
|
46
|
-
PrintConv =>
|
|
47
|
-
# extract N/S if written from Composite:GPSLatitude
|
|
48
|
-
# (also allow writing from a signed number)
|
|
49
|
-
OTHER => sub {
|
|
50
|
-
my ($val, $inv) = @_;
|
|
51
|
-
return undef unless $inv;
|
|
52
|
-
return uc $2 if $val =~ /(^|[^A-Z])([NS])(orth|outh)?\b/i;
|
|
53
|
-
return $1 eq '-' ? 'S' : 'N' if $val =~ /([-+]?)\d+/;
|
|
54
|
-
return undef;
|
|
55
|
-
},
|
|
56
|
-
N => 'North',
|
|
57
|
-
S => 'South',
|
|
58
|
-
},
|
|
74
|
+
PrintConv => \%printConvLatRef,
|
|
59
75
|
},
|
|
60
76
|
0x0002 => {
|
|
61
77
|
Name => 'GPSLatitude',
|
|
@@ -72,19 +88,7 @@ my %coordConv = (
|
|
|
72
88
|
ExifTool will also accept a number when writing this tag, positive for east
|
|
73
89
|
longitudes or negative for west, or a string containing E, East, W or West
|
|
74
90
|
},
|
|
75
|
-
PrintConv =>
|
|
76
|
-
# extract E/W if written from Composite:GPSLongitude
|
|
77
|
-
# (also allow writing from a signed number)
|
|
78
|
-
OTHER => sub {
|
|
79
|
-
my ($val, $inv) = @_;
|
|
80
|
-
return undef unless $inv;
|
|
81
|
-
return uc $2 if $val =~ /(^|[^A-Z])([EW])(ast|est)?\b/i;
|
|
82
|
-
return $1 eq '-' ? 'W' : 'E' if $val =~ /([-+]?)\d+/;
|
|
83
|
-
return undef;
|
|
84
|
-
},
|
|
85
|
-
E => 'East',
|
|
86
|
-
W => 'West',
|
|
87
|
-
},
|
|
91
|
+
PrintConv => \%printConvLonRef,
|
|
88
92
|
},
|
|
89
93
|
0x0004 => {
|
|
90
94
|
Name => 'GPSLongitude',
|
|
@@ -238,7 +242,7 @@ my %coordConv = (
|
|
|
238
242
|
Writable => 'string',
|
|
239
243
|
Notes => 'tags 0x0013-0x001a used for subject location according to MWG 2.0',
|
|
240
244
|
Count => 2,
|
|
241
|
-
PrintConv =>
|
|
245
|
+
PrintConv => \%printConvLatRef,
|
|
242
246
|
},
|
|
243
247
|
0x0014 => {
|
|
244
248
|
Name => 'GPSDestLatitude',
|
|
@@ -251,7 +255,7 @@ my %coordConv = (
|
|
|
251
255
|
Name => 'GPSDestLongitudeRef',
|
|
252
256
|
Writable => 'string',
|
|
253
257
|
Count => 2,
|
|
254
|
-
PrintConv =>
|
|
258
|
+
PrintConv => \%printConvLonRef,
|
|
255
259
|
},
|
|
256
260
|
0x0016 => {
|
|
257
261
|
Name => 'GPSDestLongitude',
|
|
@@ -615,7 +619,7 @@ GPS (Global Positioning System) meta information in EXIF data.
|
|
|
615
619
|
|
|
616
620
|
=head1 AUTHOR
|
|
617
621
|
|
|
618
|
-
Copyright 2003-
|
|
622
|
+
Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
|
|
619
623
|
|
|
620
624
|
This library is free software; you can redistribute it and/or modify it
|
|
621
625
|
under the same terms as Perl itself.
|
|
@@ -2242,7 +2242,7 @@ coordinates.
|
|
|
2242
2242
|
|
|
2243
2243
|
=head1 AUTHOR
|
|
2244
2244
|
|
|
2245
|
-
Copyright 2003-
|
|
2245
|
+
Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
|
|
2246
2246
|
|
|
2247
2247
|
This library is free software; you can redistribute it and/or modify it
|
|
2248
2248
|
under the same terms as Perl itself.
|
|
Binary file
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
# specifying $Image::ExifTool::Geolocation::altDir. This
|
|
19
19
|
# database and has entries in the same order as Geolocation.dat,
|
|
20
20
|
# and each entry is a newline-separated list of alternate names
|
|
21
|
-
# terminated by a null byte.
|
|
21
|
+
# terminated by a null byte. These alternate names are used
|
|
22
|
+
# only when searching for a city by name (eg. "Big Apple").
|
|
22
23
|
#
|
|
23
24
|
# Databases are based on data from geonames.org with a
|
|
24
25
|
# Creative Commons license, reformatted as follows in the
|
|
@@ -70,7 +71,7 @@ package Image::ExifTool::Geolocation;
|
|
|
70
71
|
use strict;
|
|
71
72
|
use vars qw($VERSION $geoDir $altDir $dbInfo);
|
|
72
73
|
|
|
73
|
-
$VERSION = '1.
|
|
74
|
+
$VERSION = '1.09'; # (this is the module version number, not the database version)
|
|
74
75
|
|
|
75
76
|
my $debug; # set to output processing time for testing
|
|
76
77
|
|
|
@@ -462,7 +463,7 @@ sub GetAltNames($;$)
|
|
|
462
463
|
sub Geolocate($;$)
|
|
463
464
|
{
|
|
464
465
|
my ($arg, $opts) = @_;
|
|
465
|
-
my ($city, @exact, %regex, @multiCity, $other, $idx, @cargs
|
|
466
|
+
my ($city, @exact, %regex, @multiCity, $other, $idx, @cargs);
|
|
466
467
|
my ($minPop, $minDistU, $minDistC, @matchParms, @coords, %fcOK, $both);
|
|
467
468
|
my ($pop, $maxDist, $multi, $fcodes, $altNames, @startTime);
|
|
468
469
|
|
|
@@ -593,8 +594,16 @@ Entry: for (; $i<@cityList; ++$i) {
|
|
|
593
594
|
}
|
|
594
595
|
@startTime and printf("= Processing time: %.3f sec\n", Time::HiRes::tv_interval(\@startTime));
|
|
595
596
|
if (%lastFound) {
|
|
596
|
-
@coords == 2
|
|
597
|
+
last if @coords == 2; # continue to use coords with last city matches
|
|
597
598
|
scalar(keys %lastFound) > 200 and warn("Too many matching cities\n"), return();
|
|
599
|
+
# return nearby cities if "num=" is used and only one match found
|
|
600
|
+
if ($num > 1 and scalar(keys %lastFound) == 1) {
|
|
601
|
+
my ($i) = keys %lastFound;
|
|
602
|
+
my @entry = GetEntry($i);
|
|
603
|
+
@coords = @entry[8,9];
|
|
604
|
+
SortDatabase('Latitude'); # (make sure we are sorted by latitude)
|
|
605
|
+
last;
|
|
606
|
+
}
|
|
598
607
|
unless (@lastByPop) {
|
|
599
608
|
@lastByPop = sort { $lastFound{$b} cmp $lastFound{$a} or $cityList[$a] cmp $cityList[$b] } keys %lastFound;
|
|
600
609
|
}
|
|
@@ -776,7 +785,7 @@ on the first call.
|
|
|
776
785
|
|
|
777
786
|
Sort database in specified order.
|
|
778
787
|
|
|
779
|
-
Image::ExifTool::Geolocation::
|
|
788
|
+
Image::ExifTool::Geolocation::SortDatabase('City');
|
|
780
789
|
|
|
781
790
|
=over 4
|
|
782
791
|
|
|
@@ -923,9 +932,10 @@ to the argument list:
|
|
|
923
932
|
both to determine the closest city matching the specified
|
|
924
933
|
name(s) instead of using GPS only.
|
|
925
934
|
|
|
926
|
-
'num=##' - When the search includes GPS coordinates,
|
|
927
|
-
|
|
928
|
-
|
|
935
|
+
'num=##' - When the search includes GPS coordinates, or when a single
|
|
936
|
+
city is matched by name, return the nearest ## cities instead
|
|
937
|
+
of just the closest or named one. Returned cities are in the
|
|
938
|
+
order from nearest to farthest.
|
|
929
939
|
|
|
930
940
|
See L<https://exiftool.org/geolocation.html#Read> for more details.
|
|
931
941
|
|
|
@@ -1005,7 +1015,7 @@ the input arguments of the AddEntry method.
|
|
|
1005
1015
|
|
|
1006
1016
|
=head1 AUTHOR
|
|
1007
1017
|
|
|
1008
|
-
Copyright 2003-
|
|
1018
|
+
Copyright 2003-2025, Phil Harvey (philharvey66 at gmail.com)
|
|
1009
1019
|
|
|
1010
1020
|
This library is free software; you can redistribute it and/or modify it
|
|
1011
1021
|
under the same terms as Perl itself. The associated database files are
|