From def0c039760812f9d12c055adeb95b2903b6da1b Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Thu, 10 May 2007 14:54:30 +0000 Subject: re-import mandriva-theme after SVN loss --- gimp/scripts/gimp-normalize-to-bootsplash.scm | 59 +++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 gimp/scripts/gimp-normalize-to-bootsplash.scm (limited to 'gimp/scripts/gimp-normalize-to-bootsplash.scm') 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 + "/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" +) -- cgit v1.2.1 From f6e4c440d34622f5ed1e4fde5a5ab047c4ac121e Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Tue, 28 Aug 2007 12:06:47 +0000 Subject: convert image to rgb before saving as jpeg (fix using indexed images as source) --- gimp/scripts/gimp-normalize-to-bootsplash.scm | 1 + 1 file changed, 1 insertion(+) (limited to 'gimp/scripts/gimp-normalize-to-bootsplash.scm') diff --git a/gimp/scripts/gimp-normalize-to-bootsplash.scm b/gimp/scripts/gimp-normalize-to-bootsplash.scm index 902abe6..6f961d8 100644 --- a/gimp/scripts/gimp-normalize-to-bootsplash.scm +++ b/gimp/scripts/gimp-normalize-to-bootsplash.scm @@ -35,6 +35,7 @@ ) (gimp-image-flatten image) + (gimp-image-convert-rgb image) (let* ((drawable (car (gimp-image-get-active-drawable image)))) -- cgit v1.2.1 From e988f5a9d92db50fbc3b8f330a5f997b8d611724 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Fri, 7 Sep 2007 17:12:31 +0000 Subject: convert image to rgb only if layer is not already rgb (fix weird gimp crash) --- gimp/scripts/gimp-normalize-to-bootsplash.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gimp/scripts/gimp-normalize-to-bootsplash.scm') diff --git a/gimp/scripts/gimp-normalize-to-bootsplash.scm b/gimp/scripts/gimp-normalize-to-bootsplash.scm index 6f961d8..16cd52c 100644 --- a/gimp/scripts/gimp-normalize-to-bootsplash.scm +++ b/gimp/scripts/gimp-normalize-to-bootsplash.scm @@ -35,9 +35,10 @@ ) (gimp-image-flatten image) - (gimp-image-convert-rgb image) (let* ((drawable (car (gimp-image-get-active-drawable image)))) + (if (= (car (gimp-drawable-is-rgb drawable)) FALSE) + (gimp-image-convert-rgb image)) (file-jpeg-save 1 image drawable outfile outfile quality 0 0 0 "Mandriva Theme" 0 1 0 0 ) (gimp-image-delete image) -- cgit v1.2.1 From a7722dda96d5cf9c72d9d67927dcbc2d7ad41cfc Mon Sep 17 00:00:00 2001 From: Frederic Crozat Date: Fri, 23 Oct 2009 12:54:55 +0000 Subject: - Do not hardcode png file as input file --- gimp/scripts/gimp-normalize-to-bootsplash.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gimp/scripts/gimp-normalize-to-bootsplash.scm') diff --git a/gimp/scripts/gimp-normalize-to-bootsplash.scm b/gimp/scripts/gimp-normalize-to-bootsplash.scm index 16cd52c..19a4c3a 100644 --- a/gimp/scripts/gimp-normalize-to-bootsplash.scm +++ b/gimp/scripts/gimp-normalize-to-bootsplash.scm @@ -31,7 +31,7 @@ (set! i (+ i 1))))) (define (gimp-normalize-to-bootsplash quality infile outfile) - (let* ((image (car (file-png-load 1 infile infile))) + (let* ((image (car (gimp-file-load 1 infile infile))) ) (gimp-image-flatten image) @@ -49,8 +49,8 @@ (script-fu-register ; I always forget these ... "gimp-normalize-to-bootsplash" ; script name to register - "/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 + "/Filters/Mandriva/Save the jpeg image to the right format for bootsplash" ; where it goes + "Transform an image to a jpg compatible image for bootsplash" ; script description "Warly/blino" ; author "Copyright 2006 by Mandriva; GNU GPL" ; copyright "2006-09-01" ; date -- cgit v1.2.1 From dc1957254f7278478414368d919a891ceb967ab3 Mon Sep 17 00:00:00 2001 From: Thomas Backlund Date: Sun, 13 Feb 2011 19:59:23 +0000 Subject: change all paths from mdk to mga --- gimp/scripts/gimp-normalize-to-bootsplash.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gimp/scripts/gimp-normalize-to-bootsplash.scm') diff --git a/gimp/scripts/gimp-normalize-to-bootsplash.scm b/gimp/scripts/gimp-normalize-to-bootsplash.scm index 19a4c3a..2d256e7 100644 --- a/gimp/scripts/gimp-normalize-to-bootsplash.scm +++ b/gimp/scripts/gimp-normalize-to-bootsplash.scm @@ -40,7 +40,7 @@ (if (= (car (gimp-drawable-is-rgb drawable)) FALSE) (gimp-image-convert-rgb image)) - (file-jpeg-save 1 image drawable outfile outfile quality 0 0 0 "Mandriva Theme" 0 1 0 0 ) + (file-jpeg-save 1 image drawable outfile outfile quality 0 0 0 "Mageia Theme" 0 1 0 0 ) (gimp-image-delete image) ) @@ -49,7 +49,7 @@ (script-fu-register ; I always forget these ... "gimp-normalize-to-bootsplash" ; script name to register - "/Filters/Mandriva/Save the jpeg image to the right format for bootsplash" ; where it goes + "/Filters/Mageia/Save the jpeg image to the right format for bootsplash" ; where it goes "Transform an image to a jpg compatible image for bootsplash" ; script description "Warly/blino" ; author "Copyright 2006 by Mandriva; GNU GPL" ; copyright -- cgit v1.2.1