0

I need to add new tags to many images, the tags are:

AboveGroundAltitude
BandName
CentralWaveLength
ColorTransform
PerspectiveDistortion
PerspectiveFocalLength
PrincipalPoint
WavelengthFWHM

I created this configuration file:


%Image::ExifTool::UserDefined = (

  'Image::ExifTool::XMP::xmp' => {
    NewXMPxmpTag => { Groups => { 1 => 'AboveGroundAltitude' } },
    NewXMPxmpTag => { Groups => { 1 => 'BandName' } },
    NewXMPxmpTag => { Groups => { 1 => 'CentralWaveLength' } },
    NewXMPxmpTag => { Groups => { 1 => 'ColorTransform' } },
    NewXMPxmpTag => { Groups => { 1 => 'PerspectiveDistortion' } },
    NewXMPxmpTag => { Groups => { 1 => 'PerspectiveFocalLength' } },
    NewXMPxmpTag => { Groups => { 1 => 'PrincipalPoint' } },
    NewXMPxmpTag => { Groups => { 1 => 'WavelengthFWHM' } },
    },
);

Variations: I've tried group 0 the first time, then read somewhere that XMP tags belong to group 1 and edited accodingly.

And I'm running the command like this:

exiftool -config config.txt -ext jpg \
-AboveGroundAltitude='55.8224668413325'\
-BandName='Red, Garbage, NIR'\
-CentralWaveLength='625, 0, 850'\
-ColorTransform='1.000, 0.000, -0.996, 0.000, 0.000, 0.000, -0.286, 0.000, 4.350'\
-PerspectiveDistortion='-0.093, 0.122, 0.000, 0.000, 0.000'\
-PerspectiveFocalLength='5.4'
-PrincipalPoint='3.100, 2.325'\
-WavelengthFWHM='100, 0, 40' test.jpg

Variations tried:

- -xmp:AboveGroundAltitude='55.8224668413325'
- -XMP-AboveGroundAltitude='55.8224668413325'
- -XMP-xmp:AboveGroundAltitude='55.8224668413325'
- all the three above with `+=` between the tag and the value

Also note the backslashes were added here for clarity, my original command is a one liner with no newlines nor backslashes.

The error I'm getting is (I'm using a mix of options tried here to illustrate different error messages, but when I tried them the style for options were normalized at each try):

Also, used -v4 for more verbose logging

exiftool -config config.txt -v4 -ext jpg -XMP-AboveGroundAltitude='55.8224668413325' -xmp:BandName='Red, Garbage, NIR' -XMP-xmp:CentralWaveLength='625, 0, 850' -xmp:ColorTransform='1.000, 0.000, -0.996, 0.000, 0.000, 0.000, -0.286, 0.000, 4.350' -PerspectiveDistortion='-0.093, 0.122, 0.000, 0.000, 0.000' -xmp:PerspectiveFocalLength='5.4' -xmp:PrincipalPoint='3.100, 2.325' -xmp:WavelengthFWHM='100, 0, 40' test.jpg

Tag 'XMP-AboveGroundAltitude' is not defined or has a bad language code
Warning: Tag 'XMP-AboveGroundAltitude' is not defined or has a bad language code
Tag 'xmp:BandName' is not defined
Warning: Tag 'xmp:BandName' is not defined
Tag 'XMP-xmp:CentralWaveLength' is not defined
Warning: Tag 'XMP-xmp:CentralWaveLength' is not defined

Sorry, xmp:ColorTransform doesn't exist or isn't writable
Warning: Sorry, xmp:ColorTransform doesn't exist or isn't writable

Tag 'PerspectiveDistortion' is not defined
Warning: Tag 'PerspectiveDistortion' is not defined
Tag 'xmp:PerspectiveFocalLength' is not defined
Warning: Tag 'xmp:PerspectiveFocalLength' is not defined
Tag 'xmp:PrincipalPoint' is not defined
Warning: Tag 'xmp:PrincipalPoint' is not defined
Tag 'xmp:WavelengthFWHM' is not defined
Warning: Tag 'xmp:WavelengthFWHM' is not defined
Nothing to do.

Notice how the message for ColorTransform is different

Note: Already seen enter link description here and other related posts here and in the exiftool forum.

FLC
  • 786
  • 1
  • 6
  • 18
  • I can't help too much atm, but your config file is backwards.You're defined the same tag name, `NewXMPxmpTag`, over and over. You're using the tag name as the group name. See the exiftool [`GetGroup` perl command](https://exiftool.org/ExifTool.html#GetGroup) for the definitions of the groups. You'll want to take a closer look at the [`example.config` file](https://exiftool.org/config.html). The most simple thing you could do would be to create the tags as just strings with `AboveGroundAltitude => { },` (continued) – StarGeek Feb 14 '20 at 16:27
  • But since that tag is a number, you could define it better with `AboveGroundAltitude => { Writable => 'rational' },` You should head over to the [ExifTool forums](https://exiftool.org/forum/index.php) where the author can give you better tips. – StarGeek Feb 14 '20 at 16:27
  • Additional question, are these tags you are creating for your own purpose? Or are these tags already embedded in some of your files and you're trying to copy them and create a definition of them? If the latter, then it's a case that you would have to make the tags in a very specific way. Displaying the raw XMP with `exiftool -XMP -B File.jpg` would be needed to see how the XMP for those tags is formmated. – StarGeek Feb 15 '20 at 02:23
  • I used your linked `example.config` as everybody on the forums link there for similar questions. I followed example five starting on line 107. Since the comments are not enough self explicative, I assumed the "Author" part was the one that defined the name of my tag and that `NewXMPxmpTag` was a command to define new tags. In the end I found a ready made configuration from the camera maker and I used it to devise the configuration I needed. I'll post the solution right now – FLC Feb 17 '20 at 14:35

1 Answers1

0

I found a configuration file made by the camera maker, which I'll paste below:

#------------------------------------------------------------------------------
# File:         xmp_camera_tags.config
#
# Description:  Adds capability to modify all XMP camera tags
#
#------------------------------------------------------------------------------

%Image::ExifTool::UserDefined = (
    'Image::ExifTool::XMP::Main' => {
        Camera=> {
            SubDirectory => {
                TagTable => 'Image::ExifTool::UserDefined::Camera',
            },
        },
    },
);
%Image::ExifTool::UserDefined::Camera = (
    GROUPS => { 0 => 'XMP', 1 => 'XMP-Camera', 2 => 'Other' },
    NAMESPACE => { 'Camera' => 'http://pix4d.com/Camera/1.0/' },
    WRITABLE => 'string',
    GPSXYAccuracy=> {},
    GPSZAccuracy => {},
    Pitch => {},
    Roll=>{},
    Yaw => {},
    BandName => { List => 'Seq' },
    CentralWavelength => { List => 'Seq' },
    WavelengthFWHM => { List => 'Seq' },
    BandSensitivity => { List => 'Seq' },
    ColorTransform => { List => 'Seq' },
 );

%Image::ExifTool::UserDefined::camera = (
    GROUPS => { 0 => 'XMP', 1 => 'XMP-Camera', 2 => 'Other' },
    NAMESPACE => { 'Camera' => 'http://pix4d.com/Camera/1.0/' },
 );
#------------------------------------------------------------------------------

and used that as a template to add the missing tags I needed.

The relevant model info for the Sentera camera is:

LensModel                       : 5.4mm-0001_0015
Model                           : 21021-03_12MP-ERS-0001

Original problem was my employee took a first batch (near 8000) of aerial photos with an old firmware. Later he updated the firmware and did the rest of the work. So when trying to process the images, the ones taken first would produce errors and the processing software refused to work.

Thanks anyway @StartGeek for your comments :)

Clearly my attempt was far, far away from what was needed, but the urgency didn't allow me time to investigate further the proper way to configure Exiftool.

FLC
  • 786
  • 1
  • 6
  • 18