wesnoth / wesnoth

An open source, turn-based strategy game with a high fantasy theme.
https://www.wesnoth.org/
GNU General Public License v2.0
5.31k stars 995 forks source link

Moving image data to the image #9023

Open doofus-01 opened 6 days ago

doofus-01 commented 6 days ago

This is the child of https://github.com/wesnoth/wesnoth/issues/8863

Figuring out how to do this without causing a lot of headaches isn't trivial - I will not address the actual image EXIF tag changes (all the images) here. The CI will also have to wait. For now, it's just getting these two maintenance scripts (derived from the existing update_copyrights script) to be ready.

Ideally, the workflow goes like this:

  1. Run csv2img-exif to read the data from the existing copyrights.csv and write that to the Exif tags of the wesnoth images
  2. Run img-exif2csv to read back the Exif tag data and give a summary of the Exif tag situation.
  3. Any new image in a PR is checked by CI for the needed tags
  4. Periodically, someone runs these two scripts, in case CI didn't catch something.

The initial run of img-exif2csv yields the attached CSV. img-exif2csv_output-original.csv

csv2img-exif got hung up on some weird data in EI, so this isn't ready for prime-time.

doofus-01 commented 5 days ago

The scripts now fully function as intended. They do take a while to run, there is probably something that should be changed, but they should only need to be run once in a blue moon.

The image output is what really matters, but what I can post here are the output CSV of these two scripts. img-exif2csv_output.csv csv2img-exif_output.csv I'd like to proceed like this:

  1. Merge these two files in this PR (low risk)
  2. Merge the image file updates in a subsequent PR (high risk, but is the real meat). Incidentally, the .webp file sizes are significantly smaller after this, due to cwebp.
  3. Update the CI workflow in a third PR (if that's the way to do it?) to check that pushed images have the correct Exif tags (medium risk, but difficult to test)
doofus-01 commented 5 days ago

I requested Pentarctagon's review because it is derived from and functionally related to his copyrights script.

Pentarctagon commented 5 days ago

Should this still be marked as a draft?

Pentarctagon commented 5 days ago

Merge the image file updates in a subsequent PR (high risk, but is the real meat). Incidentally, the .webp file sizes are significantly smaller after this, due to cwebp.

While I know it's not part of this PR, I'm a bit concerned that the file sizes of existing webp images dropped significantly. This might be due to using lossy mode instead of lossless mode on webp images previously saved as being lossless?