-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to proper set or copy EXIF tags for GTiff images #828
Comments
Perhaps you got confused by the formulation of the doc, but there's no write support for EXIF in the GeoTIFF driver. This is read-only for now. |
But what is meant with the terminus "Starting with GDAL 1.10, EXIF metadata can be extracted from the file, and will be stored the EXIF metadata domain", not the EXIF-IFD? |
That the EXIF metadata read from the file is exposed in the EXIF metadata domain. Is "exposed" less ambiguous than "stored" ? (I see there was a typo and the 'in' between 'stored' and 'the' was missing)
|
Hm, for my understanding "EXIF metadata domain" in storage terms addresses always something in the
right? I think no subsequent running program can handle that format. Is there a work around to address the EXIF IFD directly? |
no. The EXIF metadata domain is completely independent from the default "" metadata domain. |
Hm, Is there a docmentation, that goes beyond the gdal docu and class description. At the moment I'm screening the sources and look how it was implemented (gdal_translate and the -mo switch or the implentation of the GTiff datasource). But cannot see where in the "big picture" **metadata domain ** belongs to. So at least, what is addressed with the terminus metadata domain, any kind of an existing and documented IFD or GDAL internal coded schemas. |
Ok, I suppose it handles metadata in the gdal coded XML schema addressing the domain ""
and that means, metadata are more or less one-way-in-stuff. If you want write something to the EXIF domain in a certain standard manner (EXIF IFD / GPS IFD), it has to be ported on driver level (beside the abstraction level). So I think, the terminus metadata is ambiguous because it is not clear what the (abstracted/generalized diver) addresses or where the info is stored, if you use the procedure May be it is a GDAL feature request, because the processing of aerial data is often "pinned down" to industrial standards containing EXIF and GPS IFD capabilities.. But this does not belongs into an issue list. Thank you |
See also the GTiffDataset::SetMetadata() and SetMetadataItem() methods of the GTiff driver |
Yes, the but test program shows that GTiffDataset::SetMetadata() and SetMetadataItem() cannot address the EXIF IFD. Sorry for bothering and for the miss understandings. I will go on with a workaround using Phil Harveys Regards huck |
Dear community, I'm using Linux Lubuntu 18.04 with exiftool command line in order to modify TIFF-Tags of a land cover classification GeoTIFF-file. As the Python libraries
don't even list the GeoTiff tags, as they are "blind on that eye", I found that exiftool lists, but cannot change them. The output of my example file, using exiftool in the terminal, is:
Now, I'd like to change/delete the GeoTiff-TAG "Projection", which throws the following warning message without changing anything: Next, I found the following documentation of this very webpage: It states, among other details, the following:
Is there any possibility to change/rename/delete a GeoTiff-TAG of choice via command line exiftools (as stated above in my attempt), or gdal etc.? Thanks in advance for helping me out. |
Expected behaviour and actual behaviour.
I work on toolkit that automatically classifies data from a bunch of aerial cameras. Each camera uses geo-tagging and stores position and time meta-data in exif tags. I use GDAL version 2.0.2 on a device running debian 8.
When I use GDAL to copy the dataset via
GDALCreateCopy(...)
for further work all additional tags from the EXIF domain are lost. When I use,GDALSetMetadataItem(h_dataset, key, value, "EXIF"),
as proposed in the GDAL-GeoTiff documentation section Metadata, to copy the tags from the source file, the EXIF domain is empty. What is the right procedure to copy / set these tags into the new file?
Steps to reproduce the problem.
To reproduce the issue I've written a small C test program that takes a source GTiff,
GDALCreateCopy(...)
The program has the following parameter:
Usage: store-md infile outfile N|Y N|Y
N - use
GDALSetMetadataItem(h_dataset, key, value, NULL)
Y - use
GDALSetMetadataItem(h_dataset, key, value,"EXIF")
In the source file are the domains IMAGE_STRUCTURE and EXIF present. To have an GDAL independent point of view, I use Phil Harveys
exiftool
.Nature of the source.tif using store-md
Nature of the source.tif using gdalinfo
Nature of the source.tif using exiftool
The transfer of meta-data
The copy attempt finds all of these the tags an tries to write the data with different strategies into the new image. The copy strategy is given by the switches strip_it (Parameter 3) and tag_it (Parameter 4). The copy procedure looks like this:
and produces the following output:
Results ./store-md source.tif dest.tif N N
As expected due to the function call
GDALSetMetadataItem(h_ddst, key, value, NULL);
a new empty domain was created andgdalinfo
reports them as an EXIF domain but the exiftool finds them in a XML string not in the EXIF-IFD.GDALINFO
EXIFTOOL
Results ./store-md source.tif dest.tif N Y
Now the function call
GDALSetMetadataItem(h_ddst, key, value, "EXIF");
used. A new empty domain was created and the tags andgdalinfo
reports them neither in the EXIF domain nor in the default domain.Results ./store-md source.tif dest.tif Y Y
To check, if the prefix
EXIF_
like inEXIF_GPSAltitude
produces invalid tags for theEXIF-IFD
, I've removed this prefix and try to store the data in theEXIF
domain. But nothing is written to theEXIF-IFD
.Conclusion
At the moment I can not reproduce the transfer of EXIF tags to the EXIF-IFD from a proper source GTiff to a copy of that image.
Operating system
Linux: 3.16.0-6-amd64 #1 SMP Debian 3.16.57-2 (2018-07-14) x86_64 GNU/Linux
Debian 8 - Jessie
GDAL version and provenance
GDAL Version 2.0.2 version compiled from source
The text was updated successfully, but these errors were encountered: