mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-14 17:47:08 +00:00
Update CI to check for XMP rather than EXIF - for PNGs only (#9435)
Addresses GIMP metadata editing limitations
This commit is contained in:
parent
b26f446d32
commit
ccb079f05c
34
.github/workflows/image_metadata.yml
vendored
34
.github/workflows/image_metadata.yml
vendored
|
@ -27,9 +27,9 @@ jobs:
|
|||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: check image metadata
|
||||
- name: check image EXIF metadata
|
||||
run: |
|
||||
mapfile -t image_files < <(git diff --name-only --diff-filter=d "$BASE_SHA" "$HEAD_SHA" | grep -E '\.(webp|png|je?pg)$')
|
||||
mapfile -t image_files < <(git diff --name-only --diff-filter=d "$BASE_SHA" "$HEAD_SHA" | grep -E '\.(webp|je?pg)$')
|
||||
# cycle through the changed image files, make sure they have the right fields
|
||||
for file in "${image_files[@]}"; do
|
||||
# check Artist tag, fail if missing
|
||||
|
@ -56,3 +56,33 @@ jobs:
|
|||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
- name: check png XMP metadata
|
||||
run: |
|
||||
mapfile -t image_files < <(git diff --name-only --diff-filter=d "$BASE_SHA" "$HEAD_SHA" | grep -E '\.png$')
|
||||
# cycle through the changed image files, make sure they have the right fields
|
||||
for file in "${image_files[@]}"; do
|
||||
# check Creator tag, fail if missing
|
||||
artist="$(exiftool -p '$XMP:Creator' "$file")"
|
||||
if [ "$artist" ]; then
|
||||
printf 'Creator tag in %s is %s\n' "$file" "$artist"
|
||||
else
|
||||
printf 'no Creator XMP tag in %s\n' "$file"
|
||||
exit 1
|
||||
fi
|
||||
# check Rights tag, fail if missing or wrong type
|
||||
copyright="$(exiftool -p '$XMP:Rights' "$file")"
|
||||
case $copyright in
|
||||
'GNU GPL v2+'|'CC BY-SA 4.0'|CC0)
|
||||
printf 'Rights tag in %s is %s\n' "$file" "$copyright"
|
||||
;;
|
||||
'')
|
||||
printf 'no Rights XMP tag in %s\n' "$file"
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
printf 'Rights tag %s in file %s is not an accepted license! Must be one of: "GNU GPL v2+", "CC BY-SA 4.0", "CC0"\n' "$copyright" "$file"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
|
Loading…
Reference in New Issue
Block a user