scheme - GIMP - Scripting a canvas resize -
just started using gimp today. when resize canvas manually in gimp (so it's smaller image size) lets me move image around can "change" viewable area. how replicate in script? in other words, want script pause @ canvas resizing step , let me position image correctly.
the reason i'm asking: i've written small script create square thumbnails of images. way i'm doing resizing canvas height , width same. if height , width different change higher of 2 same lower (e.g. 600x500 becomes 500x500). flatten image , scale whatever need.
(if (>= width height) (begin (gimp-image-resize image height height 0 0) ) (begin (gimp-image-resize image width width 0 0) ) )
the code i'm using resize canvas above. know last 2 values in gimp-image-resize command refer offsets. want manually modify when script reaches step. appreciated. thanks!
does code work? if so, here's better-looking version of same code:
(let ((smaller-edge (min width height))) (gimp-image-resize image smaller-edge smaller-edge 0 0))
Comments
Post a Comment