[Gimp-user] Copy png to clipboard via gimp-console



Hi all,

I would like to copy a png file to the clipboard using (for instance):

gimp-console-2.8 -i -d -f -b '(png-copy "snapshot1.png")' -b '(gimp-quit 0)'

The scheme code I have for the same is attached "png-copy.scm"

However, it does not work as expected. Only an empty "carriage return" newline
is copied to the clipboard. Can someone point out what needs to be changed in my
scheme file?

Thanks for your help!

Best regards,
pUlI

png-copy.scm:

(define (png-copy pattern)
  (let* (
      (filelist (cadr (file-glob pattern 1)))
    )
    (while (not (null? filelist))
      (begin
        (catch ()
          (let* (
              (filename (car filelist))
(image (car (file-png-load RUN-NONINTERACTIVE filename filename)))
              (drawablealpha (car (gimp-image-get-active-drawable image)))
              (gimp-selection-all image)
              (gimp-edit-copy-visible drawablealpha)
            )
            (begin
              (gimp-selection-all image)
              (gimp-edit-copy (car (gimp-image-get-active-layer image)))
            )
          )
        )
        (set! filelist (cdr filelist))
      )
    )
  )
)

Attachments:
* http://www.gimpusers.com/system/attachments/483/original/png-copy.scm

-- 
pUlI (via www.gimpusers.com/forums)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]