Try this code:
Replace:
(let* ((theDuplicateImage (gimp-image-duplicate inImage)))
with:
(let* ((theDuplicateImage (car (gimp-image-duplicate inImage))))
Question
The following is part of a larger Script-fu script that I am trying write.
I have run into a problem trying to duplicate .xcf file that is open and then scale it to some user specified dimension.
The following is what I though would work:
(define (my-duplicate-and-scale inImage inDrawable inWidth inHeight)
(let* ((theDuplicateImage (gimp-image-duplicate inImage)))
(gimp-image-scale theDuplicateImage inWidth inHeight)
)
)
(script-fu-register
"my-duplicate-and-scale" ;func name
"Duplicate and Scale ..." ;menu label
"" ;description
"" ;author
"" ;copyright notice
"" ;date created
"*" ;image type that the script works on
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
SF-VALUE "Width" "512"
SF-VALUE "Height" "512"
)
(script-fu-menu-register "my-duplicate-and-scale" "<Image>/File/My")
When I execute the function I receive the following error:
Error while executing my-duplicate-and-scale:
Error: ( : 2) Invalid type for argument 1 to gimp-image-scale
According to the Procedure Browser gimp-image-duplicate
returns an IMAGE
and the first parameter to gimp-image-scale
is an IMAGE
.
Solution
Try this code:
Replace:
(let* ((theDuplicateImage (gimp-image-duplicate inImage)))
with:
(let* ((theDuplicateImage (car (gimp-image-duplicate inImage))))