08-26-2022, 07:14 PM
(08-26-2022, 06:00 PM)BaconWizard17 Wrote:(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!
Did you refresh the script (or restart Gimp)?