Skip to content

Conversation

@matthijskooijman
Copy link
Contributor

This PR extends #96 to re-add gimp2 compatibility as discussed in the comments there.

This includes:

I tested this on Debian unstable with both gimp 2.10.34-1+deb12u2 from stable and gimp 3.0.0-2 from unstable.

 * Remove implicit SIOD array accesses[1]
 * Migrate removed `drawable` API calls to `item` equivalents
 * Introduce TinyScheme `vector-ref` and `vector-length` calls
 * Migrate[2] from `get-active-layer` to `get-selected-layers`
 * Call `file-png-export` (instead of `save`) with named arguments

Refs:
 - [1] https://www.gimp.org/docs/script-fu-update.html#carempty
 - [2] https://samjcreations.blogspot.com/2022/08/api-gimp-29912-script-fu.html
This adds a second version of the gimpscript file containing the script
for gimp v2 (i.e. the version as it was before the previous commit). The
makefile now checks the gimp version and selects which of the two script
files to use based on that.

It would be nicer if the script itself checked the gimp version and
adapted accordingly, but it seems gimp v3 uses a newer scheme version
and newer syntactical elements (i.e. "#:foo" symbols) that the version
in gimp v2 does not understand, making this hard or impossible (at least
for an inexperienced scheme programmer).

This commit is intentionally separate from the previous commit (which
adapts the script for v3 compatibility), so the diff for the previous
commit is easier to read.

This is the last part to fix OpenTTD#94.
@matthijskooijman matthijskooijman force-pushed the issue-94/gimp3-scriptfu-compatibility branch from e6c7f84 to bd71438 Compare March 23, 2025 21:08
Copy link
Contributor

@jayaddison jayaddison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding my +1 approval, although as an external/non-maintainer here

@matthijskooijman
Copy link
Contributor Author

matthijskooijman commented Mar 29, 2025

Any plans to merge this and maybe also prepare a release with this in the coming days? If so, I can use that to fix the Debian package. If not (which is also fine, but I do need to know), then I will go ahead and backport these gimp fixes into the current version instead. This should be done next weekend at the latest, since Debian will go into freeze a week or so later.

@frosch123 frosch123 merged commit 9b8a707 into OpenTTD:master Mar 30, 2025
3 checks passed
@frosch123
Copy link
Member

@matthijskooijman
I would like to wait for #99 for the next release, but that one is blocked by a NML release, which is blocked ...
Please go ahead with backporting just the gimp adjustments :)

@jayaddison
Copy link
Contributor

Thanks all :)

@matthijskooijman
Copy link
Contributor Author

Thanks for the update, I've backported the changes, works like a charm (tested again on both gimp2 and gimp3): https://tracker.debian.org/news/1633899/accepted-openttd-opengfx-71-2-source-into-unstable/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants