ImageMetadata

From The Battle for Wesnoth Wiki
Revision as of 23:38, 22 March 2025 by Doofus-01 (talk | contribs) (Initial draft of image metadata guide)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Image Metadata

Author and copyright data of Wesnoth images are contained in the image metadata. For most of Wesnoth's project history, image authorship and copyrights were tracked in a separate text document. Such a document can still be generated from the metadata, but is not currently (2025) part of the commit process. There is no expectation that an artist correctly format the metadata, but the individual committing the image to the project files is expected to do so.

A lot of different programs can manipulate metadata, and they all seem to have different ways of doing it. Exiftool is platform-independent, command-line application that has been the primary toolkit applied to Wesnoth images. More info can be found at https://www.exiftool.org/index.html

Basic usage of exiftool

(This is command line to view metadata grouped by tag group exiftool -g <file> Note: WEBP must contain "Alpha" in RIFF:WebP_Flags or else the transparent background will be lost when EXIF tags are added. Exiftool can read but not write this flag (so -all= won't clobber it). GIMP will set this flag, but some "optimizing" scripts or programs can remove it.

XMP (dc "Dublin Core") tags - Used for PNG because they are most likely to be edited with GIMP

exiftool -overwrite_original -all= -Date=<Y:m:d H:M:S> -Rights=<copyright> -Creator=<name (account name)> -Description="<comment>" <target file>

EXIF - Used for WEBP and JPG, as Exif data seemed more visible in some file managers.

We could add both XMP and Exif to all images, but that would make the files larger.

exiftool -overwrite_original -all= -CreateDate=<Y:m:d H:M:S> -Copyright=<copyright> -Artist=<name (account name)> -UserComment="<comment>" <target file>

2. Metadata and CI

 A. [Required tags] Authorship and Copyright
   i.  PNG - XMP:Creator must exist
             XMP:Rights must contain "GNU GPL v2+", "CC BY-SA 4.0", or "CC0"
       
   ii.  JPEG, WEBP - EXIF:Artist must exist
                     EXIF:Copyright must contain "GNU GPL v2+", "CC BY-SA 4.0", or "CC0"
 B. [Optional tags reported in CI]
   i.  {PNG/EXIF/XMP}:{CreateDate,ModifyDate}
   ii. {XMP}:{Date}
   iii. {PNG/EXIF/XMP}:{UserComment}

3. Metadata and GIMP (2.10) - Image->Metadata->Edit Metadata

 A.  PNG - Can read/write XMP:Creator, XMP:Rights, and XMP:Description under the "Description" tab
 B.  WEBP - Can read/write XMP:Creator, XMP:Rights, and XMP:Description under the "Description" tab
 C.  JPEG - Can read IPTC:By-line or EXIF:Artist (IPTC takes precedence), shown under "Description", exports to XMP and IPTC groups

4. Metadata and Krita (5.1.5) - Layer->Edit Metadata...

 A.  PNG - Does not always import XMP:Creator or XMP:Rights, but can write to them under "Dublin Core" tab, as well as XMP:Description
 B.  WEBP - Does not seem to import anything, but can write XMP:Creator and XMP:Rights
 C.  JPEG - Can import EXIF:Artist and EXIF:Copyright, shown under "Dublin Core" as Creator & Rights, exported under IPTC:By-line and IPTC:Copyright Notice