Advertisement
deckoff

Untitled

Sep 12th, 2012
3,224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
LLVM 1.25 KB | None | 0 0
  1. (define (script-mr-kindle img draw)
  2.   (let* ( (cur-width 4) (cur-height 4) (ratio 4) (height 4) (width 4)
  3.     )
  4.   (gimp-context-set-background '( 0 0 0))
  5.           (gimp-image-set-resolution img 72 72)
  6.                   (set! cur-width  (car (gimp-image-width img)))
  7.                   (set! cur-height (car (gimp-image-height img)))
  8.                      (set! ratio      (* 450 cur-height))
  9.                       (set! height     (/ ratio cur-width))
  10.                          (gimp-image-scale img 450 height)
  11.                   (set! cur-width  (car (gimp-image-width img)))
  12.                   (set! cur-height (car (gimp-image-height img)))
  13.               (if (> cur-height 700)
  14.               (begin
  15.                 (set! ratio      (* 700 cur-width))
  16.                 (set! width     (/ ratio cur-height))
  17.                   (gimp-image-scale img width 700)
  18.                   )
  19.               )
  20.   (gimp-displays-flush)
  21.     )
  22. )
  23.  
  24. (script-fu-register
  25.   "script-mr-kindle"
  26.   "<Image>/Tools/KINDLE"
  27.   "Magic Cards - set correct parameters for printing and add black border, the image must be cropped first"
  28.   "Stoyan Deckoff <deckoff@gmail.com>"
  29.   "Stoyan Deckoff"
  30.   "25/08/2012"
  31.   "RGB* GRAY*"
  32.    SF-IMAGE "Input Image" 0
  33.   SF-DRAWABLE "Input Drawable" 0
  34. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement