summaryrefslogtreecommitdiffstats
path: root/gimp/scripts/gimp-normalize-to-bootsplash.scm
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2007-05-10 14:54:30 +0000
committerOlivier Blin <oblin@mandriva.com>2007-05-10 14:54:30 +0000
commitdef0c039760812f9d12c055adeb95b2903b6da1b (patch)
tree9d5e8543ee89510bd944c4c74ec98dc22dff9eec /gimp/scripts/gimp-normalize-to-bootsplash.scm
downloadtheme-def0c039760812f9d12c055adeb95b2903b6da1b.tar
theme-def0c039760812f9d12c055adeb95b2903b6da1b.tar.gz
theme-def0c039760812f9d12c055adeb95b2903b6da1b.tar.bz2
theme-def0c039760812f9d12c055adeb95b2903b6da1b.tar.xz
theme-def0c039760812f9d12c055adeb95b2903b6da1b.zip
re-import mandriva-theme after SVN loss
Diffstat (limited to 'gimp/scripts/gimp-normalize-to-bootsplash.scm')
-rw-r--r--gimp/scripts/gimp-normalize-to-bootsplash.scm59
1 files changed, 59 insertions, 0 deletions
diff --git a/gimp/scripts/gimp-normalize-to-bootsplash.scm b/gimp/scripts/gimp-normalize-to-bootsplash.scm
new file mode 100644
index 0000000..902abe6
--- /dev/null
+++ b/gimp/scripts/gimp-normalize-to-bootsplash.scm
@@ -0,0 +1,59 @@
+; dmmScalePNG.scm - GIMP Script-Fu to Scale a PNG Image to a New Width
+; This Script-Fu must be put in The GIMP's script directory
+; (e.g., $HOME/.gimp-1.2/scripts).
+; For interactive invocation, run The GIMP and go to
+; Xtns -> Script-Fu -> dmm
+; New width is in pixels
+;
+
+(define (gimp-normalize-to-bootsplash-dirs quality dirpattern pattern)
+ (let* ((dirs (file-glob dirpattern 1))
+ (count (car dirs))
+ (dirlist (cadr dirs))
+ (i 0))
+ (while (< i count)
+ (let* ((dirname (aref dirlist i))
+ (filepattern (strcat dirname "/" pattern)))
+ (gimp-message (strcat "Browsing " filepattern))
+ (gimp-normalize-to-bootsplash-files quality filepattern))
+ (set! i (+ i 1)))))
+
+(define (gimp-normalize-to-bootsplash-files quality pattern)
+ (let* ((files (file-glob pattern 1))
+ (count (car files))
+ (filelist (cadr files))
+ (i 0))
+ (while (< i count)
+ (let* ((infile (aref filelist i))
+ (outfile (strcat (car (strbreakup infile ".")) ".jpg")))
+ (gimp-message (strcat "Processing " infile))
+ (gimp-normalize-to-bootsplash quality infile outfile))
+ (set! i (+ i 1)))))
+
+(define (gimp-normalize-to-bootsplash quality infile outfile)
+ (let* ((image (car (file-png-load 1 infile infile)))
+ )
+
+ (gimp-image-flatten image)
+
+ (let* ((drawable (car (gimp-image-get-active-drawable image))))
+
+ (file-jpeg-save 1 image drawable outfile outfile quality 0 0 0 "Mandriva Theme" 0 1 0 0 )
+ (gimp-image-delete image)
+ )
+
+ )
+)
+
+(script-fu-register ; I always forget these ...
+ "gimp-normalize-to-bootsplash" ; script name to register
+ "<Toolbox>/Xtns/Script-Fu/Mandriva/Save the jpeg image to the right format for bootsplash" ; where it goes
+ "Transform a png image to a jpg compatible image for bootsplash" ; script description
+ "Warly/blino" ; author
+ "Copyright 2006 by Mandriva; GNU GPL" ; copyright
+ "2006-09-01" ; date
+ "" ; type of image
+ SF-VALUE "Quality" "0.9" ; default quality
+ SF-FILENAME "Infile" "infile.png"
+ SF-FILENAME "Infile" "outfile.jpg"
+)