Recent posts

#1
Other Discussion / Re: thankyou for Exiftool & it...
Last post by Phil Harvey - May 22, 2025, 09:55:55 PM
Sorry.  My mistake.

I've restored the post with the hyperlinks.

- Phil
#2
The Image::ExifTool API / Re: Apparent failure to write
Last post by Phil Harvey - May 22, 2025, 09:44:23 PM
Aside from a problem with the balancing of braces in your script, I don't see anything wrong.  I had to modify things somewhat to be able to run this, but this seems to work as expected:

Here is the script I used (called "ttt"):

#!/usr/bin/perl
use strict;
use warnings;

use Image::ExifTool;

my $exifTool = Image::ExifTool->new;

my @oldRegionName = qw(test1 test2);
my @regionName = ('new');

# clear all current fields in region
for my $i (0 .. $#oldRegionName)
{
    my ($success, $errStr) = $exifTool->SetNewValue('XMP-mwg-rs:RegionList' => {
        'Name' => $oldRegionName[$i],
        },
        DelValue => 1);
}
# now repopulate region fields
for my $i (0 .. $#regionName)
{
    my ($success, $errStr) = $exifTool->SetNewValue('XMP-mwg-rs:RegionList' => {
                                                    'Name' => $regionName[$i],
                                                        'Type' => 'Face',
                                                        'Area' => {
                                                            'H'    => 1,
                                                            'Unit' => "normalized",
                                                            'W'    => 2,
                                                            'X'    => 3,
                                                            'Y'    => 4,
                                                        }
                                                    },
                                                    AddValue => 1);
}
$exifTool->Options(Verbose => 3);
$exifTool->WriteInfo('a.xmp');

And here is the result:

> rm a.xmp
> exiftool a.xmp -regionlist='{name=test1,type=pet}' -regionlist='{name=test2,type=pet}' -regionlist="{name=test3,type=pet}"
    1 image files created
> exiftool a.xmp -struct -xmp:all
XMP Toolkit                     : Image::ExifTool 13.30
Region Info                     : {RegionList=[{Name=test1,Type=Pet},{Name=test2,Type=Pet},{Name=test3,Type=Pet}]}
> ./ttt
Rewriting a.xmp...
  FileType = XMP
  FileTypeExtension = XMP
  MIMEType = application/rdf+xml
    - XMP-mwg-rs:Regions/mwg-rs:RegionList/rdf:Bag/rdf:li 10/mwg-rs:Name = 'test1'
    - XMP-mwg-rs:Regions/mwg-rs:RegionList/rdf:Bag/rdf:li 10/mwg-rs:Type = 'Pet'
    - XMP-mwg-rs:Regions/mwg-rs:RegionList/rdf:Bag/rdf:li 11/mwg-rs:Name = 'test2'
    - XMP-mwg-rs:Regions/mwg-rs:RegionList/rdf:Bag/rdf:li 11/mwg-rs:Type = 'Pet'
    + XMP-mwg-rs:Regions/mwg-rs:RegionList/rdf:Bag/rdf:li 10/mwg-rs:Area/stArea:h = '1'
    + XMP-mwg-rs:Regions/mwg-rs:RegionList/rdf:Bag/rdf:li 10/mwg-rs:Area/stArea:unit = 'normalized'
    + XMP-mwg-rs:Regions/mwg-rs:RegionList/rdf:Bag/rdf:li 10/mwg-rs:Area/stArea:w = '2'
    + XMP-mwg-rs:Regions/mwg-rs:RegionList/rdf:Bag/rdf:li 10/mwg-rs:Area/stArea:x = '3'
    + XMP-mwg-rs:Regions/mwg-rs:RegionList/rdf:Bag/rdf:li 10/mwg-rs:Area/stArea:y = '4'
    + XMP-mwg-rs:Regions/mwg-rs:RegionList/rdf:Bag/rdf:li 10/mwg-rs:Name = 'new'
    + XMP-mwg-rs:Regions/mwg-rs:RegionList/rdf:Bag/rdf:li 10/mwg-rs:Type = 'Face'
> exiftool a.xmp -struct -xmp:all
XMP Toolkit                     : Image::ExifTool 13.30
Region Info                     : {RegionList=[{Area={H=1,Unit=normalized,W=2,X=3,Y=4},Name=new,Type=Face},{Name=test3,Type=Pet}]}

This is the result I expected (the "test1" and "test2" regions in the list were replaced by the new region.

- Phil
#3
The Image::ExifTool API / Apparent failure to write
Last post by Tom Cunningham - May 22, 2025, 06:20:03 PM
This has me completely flummoxed. It harkens back to this thread but with a twist. I have this code:

# clear all current fields in region
for my $i (0 .. $#oldRegionName)
{
    ($success, $errStr) = $exifTool->SetNewValue('XMP-mwg-rs:RegionList' => {
        'Name' => $oldRegionName[$i],
        },
        DelValue => 1) || errExit($file, __LINE__, $errStr);
}
# now repopulate region fields
for my $i (0 .. $#regionName)
{
    ($success, $errStr) = $exifTool->SetNewValue('XMP-mwg-rs:RegionList' => {
                                                    'Name' => $regionName[$i],
                                                        'Type' => $regionType[$i],
                                                        'Area' => {
                                                            'H'    => $regionAreaH[$i],
                                                            'Unit' => "normalized",
                                                            'W'    => $regionAreaW[$i],
                                                            'X'    => $regionAreaX[$i],
                                                            'Y'    => $regionAreaY[$i]
                                                        }
                                                    },
                                                    AddValue => 1) ||
                                    errExit($file, __LINE__, $errStr);
    }
}

In previous code I've removed one element from the region arrays (a duplicate face tag). So with the first for loop I (presumably) clear all the existing fields in the region arrays (4 elements). Then in the second for loop I repopulate the region arrays, this time with only 3 elements. After some subsequent operations not involving the regions, I perform an $exifTool->WriteInfo($fn), where $fn is the filename. After that I check the file with exiftool and there are still 4 elements in the region arrays. It's as if the write didn't happen. What the heck am I missing here? Thanks.

#4
Other Discussion / Re: thankyou for Exiftool & it...
Last post by Luck - May 22, 2025, 05:13:05 PM
Hello Phil,
Please do remove the post, and I will delete this account. I had looked for another way to contact you to share my music, as I was quite grateful for Exiftool in releasing it, but only found this. I'm a big fan of open sourced ideas, thank you for your efforts.
Nice chatting with you.
I do look forward to a day when we can all be less suspicious of one another again.

#5
Metadata / Re: FujiFilm X-HF1 (aka FujiFi...
Last post by Phil Harvey - May 22, 2025, 11:15:14 AM
Great, thanks.  I'll add this new value.

- Phil
#6
Version 13.30 will include a patch to remove the warning for undefined tags in a -if condition.

The reason for this warning was to inform the user that the -m option could be used to set the undefined values to an empty string, but as you point out the warning was emitted inconsistently, and I can't see a better way to fix this, so the user will just have to be aware of this feature.  (It is mentioned in the -m option documentation.)

- Phil
#7
Metadata / FujiFilm X-HF1 (aka FujiFilm X...
Last post by greybeard - May 22, 2025, 10:45:32 AM
FujiFilm has just released a new camera - jpeg only - "inspired by half frame film cameras".

There may be new makernotes tags and new values of existing tags.

I'm not going to get one of these cameras but here is a first update from samples published online:

0x1201 - Advanced Filter : 0x100000 - Light Leak

There are other new values for this tag including "Halation" and "Expired Film" but I've not seen samples yet.
#8
Other Discussion / Re: thankyou for Exiftool & it...
Last post by Phil Harvey - May 22, 2025, 09:27:04 AM
I'm sorry, but this sounds suspiciously like you are just spamming your album.  Your post could be made to literally any online forum.  Unless you post back with some ExifTool-specific content I will be removing this post.  I've already deleted your 2nd post containing the hyperlinks.

- Phil
#9
The "exiftool" Application / Re: Geolocate tag can't includ...
Last post by Phil Harvey - May 22, 2025, 09:21:05 AM
Hi Mike,

Looking into this further, I think that StarGeek had the answer.  The specification for XMP-iptcCore:Location and IPTC:Sub-Location doesn't fit with the larger-area county or sub-region name returned by ExifTool's GeolocationSubregion.

- Phil
#10
The "exiftool" Application / Re: Same script, same images, ...
Last post by Phil Harvey - May 22, 2025, 08:55:05 AM
This will happen if GPSTimeStamp has been written incorrectly as the string "2019-04-12T13:26:01.96+0000" instead of the specified 3 rational values.  I have no idea how this could happen.  Some other misbehaving software I would think.  To do this with ExifTool would require using a badly written config file.

But this is only a warning so the affected files will still be processed, and it will only affect the value of GPSTimeStamp which you probably aren't using.

- Phil