I need to add the ExifIFD OwnerName tag 0xfde8 (there is another OwnerName tag 0xa430). I need to and a string (xml format) to this tag, as the SNAP-STEP ESA software use this tag (embedded xml file ) when exporting data to GeoTIFF format . I have produced the xml, however I am not able to add it to the my processed image (32 bits data, large number of bands).
"exiftool -IgnoreMinorErrors -Exif:OwnerName=xml_string add2tif_file"
exiftool read the output, the OwnerName xml string is correctly added. However it is not assigned to 0xfde8 ExifIFD tag.
Is it it possible to specify the Exif tag hexadecimal code in exiftool call?
Best Regards
Josep
Hi Josep,
I will admit that this one would be a bit difficult to figure out. You need to use the family 7 group name to distinguish between these tags. Here is a command that uses this group name to write the tag you want:
exiftool -id-0xfde8:ownername=xml_string FILE
You can also specify the ID in decimal:
exiftool -id-65000:ownername=xml_string FILE
- Phil
Hi Phil
I have tried the command that you provided, however It does not work. I have succeeded in adding 65000 tag (the SNAP-STEP software correctly reads the xml added string), using the Python pillow package with 3 layers (8 bits) images. Unfortunately the pillow package neither supports multilayer 32 bits images, nor more than four layers 8 bits images. Due to that I require to look for other options, so I were wondering if exifftool could solve my problem.
Just to test, I have tested the command you have provided with the three layers 8 bits images and it also does not work, conversely to the pillow package that succeeds with this kind of images.
NOTE: It is a little bit weird the use that SNAP-STEP software does of 65000 exif tag in GeoTIFF images. I suppose that It is due to the fact that the format that they use (BEAM-DIMAP), allows them to include a lot of information about the processed products (in xml format). They have chosen the exif tag 65000, to include that information when exporting to GeoTIFF format. The problem is that for their software the information provided in this tag prevails over other standard metadata. This causes problems both when reading the GeoTIFF images exported from SNAP using other tools or when you want to use images produced by other tools in SNAP-STEP.
The command I gave does work if you use a recent version of ExifTool.
- Phil
Hi Phil
I have updated exiftool to 12.77 version. The command works and add add a tag to the image. The output of exiftool shows the name Owner Name : {the xml added string}
However the SNAP software fails to open the image throwing an exception. Reading the image using python the package tifffile do not find the tag 65000, they shows the added tag as 34665 (0x8769, ExifOffset) instead . The output of tifffile reading the tag is as name ExifTag, as code 34665 and value as {'ExifVersion': '0232', 'ComponentsConfiguration': b'\x01\x02\x03\x00', 'FlashpixVersion': '0100', 'ColorSpace': 65535, 'OwnerName': 'Owner\'s Name: {the xml added string} }. The code do not match the 65000 tag and the value in addition to the xml string contains other extra fields.
The GeoTIFF images SNAP produced (or with suitable 65000 tag added) shows the same output of exiftool name Owner Name : {the xml string}. However the tifffile read the tag name as '65000', code as 65000 and as value just {the xml string}. So the SNAP software opens correctly the images.
The exiftool shows the same output for both cases, however the added tag it is not the same for other tools. The output of tifffile is different and SNAP opens correctly one of the images while fails in the other one.
It sounds like you are writing the tag in the wrong location. You should specify which IFD you want to write. Run exiftool -G1 FILE on a file with the tag in the correct location, and add this location to the tag when writing,
eg) -IFD0:id-65000:ownername=xml_string
- Phil
Hi Phil
The command exiftool -G 1 over a file with the tag correctly read shows the position IFD0 for the 65000 tag. Running
exifftool -IFD0:id-65000:ownername=xml_string
add the tag to the image. The tifffile python package now read the correct tag name as '65000' and the correct tag code as 65000 (and their correct xml_string tag value ). From the exiftool and tifffile package sides it is now apparently correct.
The SNAP software opens the image (tag 65000 exiftool added) without exception, however it does not use the information of 65000 tag. Conversely the same image with the same tag 65000 python added, is correctly used by SNAP. I have compared the exiftool -G 1 output over both images and they are the same (the differences are only those related to the [system] fields)