Author Topic: -tagsfrom file  (Read 115 times)


  • Newbie
  • *
  • Posts: 6
-tagsfrom file
« on: March 22, 2019, 05:31:18 AM »

I have a folder with some file.tif, these files are orthophotos and contain a lot of specific tags useful to project the image in specific software, in the other folder I have file.png with the same name but different extension, the png image are the result of machine learning algorithms, I need to transfer all the tags from tif to png.

I have used this line:

exiftool -tagsfromfile directory\%f.TIF -ext PNG -all:all -xmp directory2

The transfer happen but it is not complete.
The main tag lost is:

GDAL Metadata                   : <GDALMetadata>.  <Item name="LL_LAT">-0.00497598271485068418</Item>.  <Item name="LL_LON">10.51024821201293413253</Item>.  <Item name="LR_LAT">-0.00497599193986235974</Item>.  <Item name="LR_LON">10.51159206089769249104</Item>.  <Item name="UL_LAT">-0.00362307822473520230</Item>.  <Item name="UL_LON">10.51024821993168067991</Item>.  <Item name="UR_LAT">-0.00362308494158708949</Item>.  <Item name="UR_LON">10.51159206881408891832</Item>.</GDALMetadata>.

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14438
    • ExifTool Home Page
Re: -tagsfrom file
« Reply #1 on: March 22, 2019, 07:08:47 AM »
Currently, GDALMetadata is not writable.  I will change this in ExifTool 11.33, but until then you can use this command:

exiftool -config my.config -tagsfromfile directory\%f.TIF -ext PNG -all:all -xmp directory2

with this my.config file:

Code: [Select]
%Image::ExifTool::UserDefined = (
    'Image::ExifTool::Exif::Main' => {
        0xa480 => {
            Name => 'GDALMetadata',
            Writable => 'string',
            WriteGroup => 'IFD0',

1;  #end

(I'm assuming that this goes in IFD0.  Use "exiftool -G1 -gdalmetadata FILE" on an existing file to verify this.)

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