5 hours ago
I am trying to manipulate images stored in files.
As a first exercise, I tried to open an image, and then save it to a file
with another name. Note both the source and the destination files already
exist in the file system before my manipulation. I do not mind overwriting
the contents of the destination file.
The code I have tried is:
When running this code, I am prompted to choose the input and output files. There also seems to be a brief
message at the bottom of the screen about one of gimp-file-load or gimp-file-save. Other then that, nothing
happens. In particular, nothing seems to change for the output file.
If I run gimp from the terminal, and quit gimp after running this script-fu I get (in the terminal)
As a first exercise, I tried to open an image, and then save it to a file
with another name. Note both the source and the destination files already
exist in the file system before my manipulation. I do not mind overwriting
the contents of the destination file.
The code I have tried is:
Code:
(script-fu-register
"copy" ;func name
"copy" ;func label
"Copy a file containing an image to another file. Both file exist in the file system. The destination file will be overwritten." ;description
"" ;author
"" ;copyright notice
"" ;date created
"" ;image type that the script works on
SF-FILENAME "Input file" ""
SF-FILENAME "Output file" ""
)
(script-fu-menu-register "copy" "<Image>/Image/Transform/")
(define (copy inImgFile outImgFile)
(let* (
(image (car (gimp-file-load
RUN-INTERACTIVE
inImgFile
)
)
)
(gimp-file-save
RUN-INTERACTIVE
image
outImgFile
%NULL
)
)
)
)message at the bottom of the screen about one of gimp-file-load or gimp-file-save. Other then that, nothing
happens. In particular, nothing seems to change for the output file.
If I run gimp from the terminal, and quit gimp after running this script-fu I get (in the terminal)
Message in the terminal Wrote:INFO: a stray image seems to have been left around by a plug-in: "[name of the input file, without extension] (imported)"What am I doing wrong?

