08-26-2022, 06:00 PM
(This post was last modified: 08-26-2022, 06:12 PM by BaconWizard17.)
(08-25-2022, 07:47 AM)Kevin Wrote: You need to know that most GIMP functions in script-fu return a list, not a single value, so you need to extract the first value from the list:
Code:
(newWidth (car (gimp-image-width image)))
(newHeight (car (gimp-image-height image)))
That makes sense. Unfortunately, I'm still getting the same error with this:
Code:
(define (script-fu-scale-half image)
(gimp-image-undo-group-start image)
(gimp-selection-none image)
(let*
(
(newWidth (car (gimp-image-width image)))
(newHeight (car (gimp-image-height image)))
)
(gimp-image-scale image (/ newWidth 2) (/ newHeight 2))
)
(gimp-displays-flush)
(gimp-image-undo-group-end image)
)
Edit: I wish I knew why, but it inexplicably started working without me changing anything (as far as I can tell). It works now!
Modder/Skinner at MarvelMods.com using GIMP to create, edit, and export textures and previews more efficiently.
My GIMP scripts hosted on GitHub
My GIMP scripts hosted on GitHub