Skip to content

Commit

Permalink
GTiff: insert GDAL_RELEASE_NICKNAME in GDAL_METADATA tag
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Feb 20, 2025
1 parent 26fc9a3 commit 938f38e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions frmts/gtiff/gtiffdataset_write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3790,16 +3790,21 @@ static void AppendMetadataItem(CPLXMLNode **ppsRoot, CPLXMLNode **ppsTail,
/* Create root, if missing. */
/* -------------------------------------------------------------------- */
if (*ppsRoot == nullptr)
{
*ppsRoot = CPLCreateXMLNode(nullptr, CXT_Element, "GDALMetadata");

*ppsTail =
CPLCreateXMLNode(*ppsRoot, CXT_Comment,
std::string("GDAL release nickname: ")
.append(GDALVersionInfo("RELEASE_NICKNAME"))
.c_str());
}

/* -------------------------------------------------------------------- */
/* Append item to tail. We keep track of the tail to avoid */
/* O(nsquared) time as the list gets longer. */
/* -------------------------------------------------------------------- */
if (*ppsTail == nullptr)
CPLAddXMLChild(*ppsRoot, psItem);
else
CPLAddXMLSibling(*ppsTail, psItem);
CPLAddXMLSibling(*ppsTail, psItem);

*ppsTail = psItem;
}
Expand Down

0 comments on commit 938f38e

Please sign in to comment.