Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scale image relative size?
#7
(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)?
Reply


Messages In This Thread
Scale image relative size? - by BaconWizard17 - 08-14-2022, 02:46 PM
RE: Scale image relative size? - by Ofnuts - 08-14-2022, 03:15 PM
RE: Scale image relative size? - by BaconWizard17 - 08-25-2022, 12:15 AM
RE: Scale image relative size? - by rich2005 - 08-14-2022, 03:55 PM
RE: Scale image relative size? - by Kevin - 08-25-2022, 07:47 AM
RE: Scale image relative size? - by BaconWizard17 - 08-26-2022, 06:00 PM
RE: Scale image relative size? - by Ofnuts - 08-26-2022, 07:14 PM
RE: Scale image relative size? - by BaconWizard17 - 08-27-2022, 07:08 PM

Forum Jump: