Contents of .ExifTool_config

Started by Alan Clifford, August 19, 2015, 11:46:44 AM

Previous topic - Next topic

Alan Clifford

I'm at the stage of going to use the API to write the depth to my underwater photos.  Up to know, I've been reusing functions to read stuff from photos so haven't had to actually re-learn anything about the API.

Couple of questions about the config. file

When testing the config., I can


egremont:suunto-test alan$ exiftool -UWDepth=-27 f200_3292.jpg
    1 image files updated

egremont:suunto-test alan$ exiftool -UWDepth f200_3292.jpg -G -s2
[XMP] UWDepth: -27
egremont:suunto-test alan$ exiftool -UWDepth f200_3292.jpg -G1 -s2
[XMP-uw] UWDepth: -27
egremont:suunto-test alan$ exiftool -UWDepth f200_3292.jpg -G2 -s2
[Location] UWDepth: -27


which looks OK

First question.  Is this .Exif_config file OK?

egremont:scripts alan$ cat ~/.ExifTool_config
# exiftool -config example.config ...

# The %Image::ExifTool::UserDefined hash defines new tags to be added
# to existing tables.
%Image::ExifTool::UserDefined = (
    'Image::ExifTool::XMP::Main' => {
        # date and time with timezone in xmp:datetimeoriginal
        uw => {
            SubDirectory => {
                TagTable => 'Image::ExifTool::UserDefined::uw',
                # (see the definition of this table below)
            },
        },
    },


);

# This is a basic example of the definition for a new XMP namespace.
# This table is referenced through a SubDirectory tag definition
# in the %Image::ExifTool::UserDefined definition above.
# The namespace prefix for these tags is 'uw', which corresponds to
# an ExifTool family 1 group name of 'XMP-uw'.
%Image::ExifTool::UserDefined::uw = (
    GROUPS => { 0 => 'XMP', 1 => 'XMP-uw', 2 => 'Location' },
    NAMESPACE => { 'uw' => 'http://xmpns.clifford.ac/uw/' },
    WRITABLE => 'string',
    UWDepth => { Writable => 'real' },
    UWAltitudeSurface => { Writable => 'real' },
    UWAltitude => { Writable => 'real' },
);




Second question.

As exiftool will read my new UWdepth without the config file, could I move the config. stuff into the Perl program that I will use to write the information?

Phil Harvey

Quote from: Alan Clifford on August 19, 2015, 11:46:44 AM
egremont:suunto-test alan$ exiftool -UWDepth f200_3292.jpg -G -s2
[XMP] UWDepth: -27
egremont:suunto-test alan$ exiftool -UWDepth f200_3292.jpg -G1 -s2
[XMP-uw] UWDepth: -27
egremont:suunto-test alan$ exiftool -UWDepth f200_3292.jpg -G2 -s2
[Location] UWDepth: -27

Just FYI, you can do this:  exiftool -UWDepth f200_3292.jpg -G0:1:2 -s2

QuoteIs this .Exif_config file OK?

Looks good to me.

QuoteAs exiftool will read my new UWdepth without the config file, could I move the config. stuff into the Perl program that I will use to write the information?

Yes.  Since you are using very simple tag definitions, the only thing you won't get when reading without the config file are the family 2 groups.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Alan Clifford

Quote from: Phil Harvey on August 19, 2015, 11:51:59 AM

Just FYI, you can do this:  exiftool -UWDepth f200_3292.jpg -G0:1:2 -s2

I should have been able to guess that you would have implemented something like that.


QuoteAs exiftool will read my new UWdepth without the config file, could I move the config. stuff into the Perl program that I will use to write the information?
Quote
Yes.  Since you are using very simple tag definitions, the only thing you won't get when reading without the config file are the family 2 groups.

Thanks.  I'll have a go at that.

Alan Clifford

Wrong section I suppose, but still about .ExifTool_config.

I have an old bash script that does stuff to a photograph - rotates, size, watermark.

Due to stuff such as:# jpegtran will not copy both exif and comments
# mogrify does not copy IPTC data
# jhead copying of exif seems to destroy commnents
# jhead refers to one comment whereas there can be several
# jpegexiforient seems to baulk after jpegtran copies exif
# Get this order right


most of which I don't use anymore, I copy metadata from the original file into the processed file.  Testing this with

exiftool -overwrite_original_in_place -tagsfromfile ~/photographs/temp/f200_3121.jpg -all:all f200_3121.jpg
    1 image files updated
exiftool -uw* f200_3121.jpg
UW Depth                        : 6.0198


UWDepth exists in the processed file but, as I haven't got the .ExifTool_config file in place, shouldn't I have got an error when trying to write UWdepth from the original to the processed file with all:all?


Phil Harvey

I think that you will see these warnings if you add -v2, but then you will also see why they aren't visible by default.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Alan Clifford

exiftool -v2 -overwrite_original_in_place -tagsfromfile ~/photographs/temp/f200_3121.jpg -all:all f200_3121.jpg | less -i

I think I see what is happening.  Searching the output for uw finds nothing without the .ExifTool_config file in place so the tag is being completely ignored.   I wasn't expecting that;  I was expecting it to be read and then warned/ignored.

Not a problem, I was just curious and it's good to know what is going to happen with this tag in different circumstances.

Phil Harvey

Ah, sorry.  It needs to be -v3.  You should get this:  "Tag 'UWDepth' does not exist".

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).