<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Luigi,</p>
    <p>The GDAL GeoTIFF or COG drivers have currently no provision for
      writing EXIF (the fact that you see Exif.Image.Software is due to,
      I assume, exiftool synthetizing that information from the regular
      Software TIFF tag, which is propagated), so I don't have any
      solution to offer. Could potentially be implemented, but not a
      5-minute job.</p>
    <p>"Breaking" the COG structure shouldn't be the end of the world.
      The breakage should be minimal. That will just cause one extra
      HTTP GET to clients. 95% of the value of COG is just being a tiled
      GeoTIFF with overviews. Putting all metadata (including the main
      TIFF directory) at beginning of the file is just the cherry on the
      cake.</p>
    <p>(a quick skim at <a class="moz-txt-link-freetext" href="https://github.com/airbusgeo/cogger">https://github.com/airbusgeo/cogger</a> which is
      useful to COGify a tiled GeoTIFF doesn't show any provision for
      EXIF, so I don't think you can use it for your use case)</p>
    <p>The XMP TIFF tag is propagated:</p>
    <p>$ gdal_translate autotest/gdrivers/data/gtiff/byte_with_xmp.tif
      out.tif -of cog</p>
    <p>$ gdalinfo out.tif -mdd all | grep XMP<br>
      Metadata (xml:XMP):<br>
           <rdf:li>XMP</rdf:li><br>
      <br>
    </p>
    <p>Even<br>
    </p>
    <div class="moz-cite-prefix">Le 14/11/2024 à 12:39, Luigi Pirelli
      via gdal-dev a écrit :<br>
    </div>
    <blockquote type="cite"
cite="mid:CAFO80_rOb9JDtuWrc=ei8pcyMXgvXfR=5A=ZKF1uS3L3vm1MZg@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div>Hi,</div>
        <div><br>
        </div>
        <div>I'm struggling to generate a COG maintaining the original
          (or at least a selected subset of) Exif and XMP tags (I ses
          that Iptc tags are not propagated at all, but I'm not
          interested in them).<br>
          I used gda_translate via CLI or python and the best option
          seems -strict that, theoretically should maintain all original
          tags.<br>
          <br>
          But some standard tags are propagated and others not!</div>
        <div>e.g.</div>
        <div>Exif.Image.Software yes</div>
        <div>Exif.Photo.CameraOwnerName no<br>
        </div>
        <div>Exif.Image.Artist yes<br>
        </div>
        <div>Exif.Image.Copyright yes<br>
        </div>
        <div>Exif.Image.DateTimeOriginal no<br>
        </div>
        <div>Exif.Photo.DateTimeOriginal no<br>
        </div>
        <div>Exif.Image.Model no<br>
        </div>
        <div>Exif.Image.CameraSerialNumber no</div>
        <div>etc</div>
        <div><br>
        </div>
        <div>It is a bug? a feature? if a bug in any case is there a way
          to override? The reason to find a solution is that adding tags
          over a COG with "standard" tools like exiftool, exiv2 etc
          destroy COG structure. So I need to add or modify tags before
          converting to COG.</div>
        <div><br>
        </div>
        <div>any suggestion?</div>
        <div><br>
        </div>
        <div>
          <div dir="ltr" class="gmail_signature"
            data-smartmail="gmail_signature">
            <div dir="ltr">
              <div>
                <div dir="ltr">
                  <div>
                    <div dir="ltr">
                      <div>
                        <div dir="ltr">
                          <div>Luigi Pirelli</div>
                          <div>mails: <a href="mailto:luipir@gmail.com"
                              moz-do-not-send="true"
                              class="moz-txt-link-freetext">luipir@gmail.com</a></div>
                          <div>           <a
                              href="mailto:luigi.pirelli@geobeyond.it"
                              moz-do-not-send="true"
                              class="moz-txt-link-freetext">luigi.pirelli@geobeyond.it</a><br>
                            <br>
**************************************************************************************************<br>
                            * LinkedIn: <a
href="https://www.linkedin.com/in/luigipirelli" target="_blank"
                              moz-do-not-send="true"
                              class="moz-txt-link-freetext">https://www.linkedin.com/in/luigipirelli</a><br>
                            * Stackexchange: <a
href="http://gis.stackexchange.com/users/19667/luigi-pirelli"
                              target="_blank" moz-do-not-send="true"
                              class="moz-txt-link-freetext">http://gis.stackexchange.com/users/19667/luigi-pirelli</a><br>
                            * GitHub: <a
                              href="https://github.com/luipir"
                              target="_blank" moz-do-not-send="true"
                              class="moz-txt-link-freetext">https://github.com/luipir</a><br>
                            * Book: <a
href="https://www.packtpub.com/eu/application-development/mastering-geospatial-development-qgis-3x-third-edition"
                              target="_blank" moz-do-not-send="true">Mastering
                              QGIS3 - 3rd Edition</a></div>
                          <div>**************************************************************************************************</div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.
Butcher of all kinds of standards, open or closed formats. At the end, this is just about bytes.</pre>
  </body>
</html>