GIMP Script-fu

Changes On Branch sg-goobie
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Changes In Branch sg-goobie Excluding Merge-Ins

This is equivalent to a diff from cf23bd898b to c4201689f7

2015-05-22
21:34
Create new branch named "sg-layer-bake" check-in: c4e75ba86e user: saul tags: sg-layer-bake
2015-03-27
01:38
Create new branch named "sg-group-linked-layers" check-in: a8849c0376 user: saul tags: sg-group-linked-layers
2015-03-25
17:33
Create new branch named "sg-decompose-text-layer" check-in: a1515524c2 user: saul tags: sg-decompose-text-layer
2015-03-17
18:49
Create new branch named "sg-render-palette-preview" check-in: 4f1cbefb4c user: saul tags: sg-render-palette-preview
2015-02-25
08:28
Create new branch named "schemey-fu" check-in: 5bbe976611 user: saul tags: schemey-fu
2015-02-24
07:14
Create new branch named "sg-schemy-fu" check-in: 07ab821547 user: saul tags: sg-schemy-fu
2015-02-08
14:29
Create new branch named "sg-ungroup-layer" check-in: 5efa4c1218 user: saul tags: sg-ungroup-layer
12:53
Create new branch named "sg-splice-grouped-layer" Closed-Leaf check-in: 5e982d637f user: saul
12:35
Create new branch named "sg-splice-group" Closed-Leaf check-in: 1c8774511c user: saul
2015-02-04
08:25
Create new branch named "sg-add-group-mask" check-in: 0d5aa5c54f user: saul tags: sg-add-group-mask
2015-01-24
20:37
Create new branch named "sg-text-sphere" check-in: 836e1da14d user: saul tags: sg-text-sphere
2014-12-19
23:46
Create new branch named "sg-dump-path-colors" check-in: c5f6d76f4c user: saul tags: sg-dump-path-colors
2014-12-06
17:40
Create new branch named "sg-float-layer" check-in: 9e12bc0967 user: saul tags: sg-float-layer
2014-11-08
23:30
Create new branch named "sg-save-all-layers-to-directory" check-in: f711177647 user: saul tags: sg-save-all-layers-to-directory
23:28
Create new branch named "sg-save-all-layers-to-directory.scm" Leaf check-in: 1745a103d0 user: saul tags: sg-save-all-layers-to-directory.scm
2014-11-04
05:56
Create new branch named "sg-save-pdf-multi" check-in: f1259633d4 user: saul tags: sg-save-pdf-multi
2014-10-19
18:33
Create new branch named "sg-split-strokes" check-in: db1b5362c8 user: saul tags: sg-split-strokes
2014-10-14
10:06
Create new branch named "srfi26-cute-cut" check-in: e6d98719ae user: saul tags: srfi26-cute-cut
2014-10-05
02:21
Create new branch named "sg-fvful" check-in: d8b478ea27 user: saul tags: sg-fvful
2014-09-13
08:36
Create new branch named "sg-merge-retain-rgb" check-in: e37665ce07 user: saul tags: sg-merge-retain-rgb
2014-07-13
11:16
Create new branch named "sg-grid-layer" check-in: 9c302f4f80 user: saul tags: sg-grid-layer
2014-06-04
14:51
Create new branch named "sg-de-mirror" check-in: 506e951f8f user: saul tags: sg-de-mirror
2014-04-04
23:24
Create new branch named "sg-STW-brochures" check-in: 1339ddf45c user: saul tags: sg-STW-brochures
2014-03-23
18:37
Create new branch named "sg-process-tga-files" check-in: aa1fa9108d user: saul tags: sg-process-tga-files
2014-03-22
00:16
Create new branch named "sg-with-files" check-in: d7e5d36797 user: saul tags: sg-with-files
2014-03-17
12:12
Create new branch named "sg-sequential-edit" check-in: 68950ba1e6 user: saul tags: sg-sequential-edit
2014-03-04
22:49
Create new branch named "sg-save-all-projections" check-in: 3750033250 user: saul tags: sg-save-all-projections
2014-03-01
17:28
Create new branch named "sg-stash-guides" check-in: 3135a9f5a4 user: saul tags: sg-stash-guides
2014-02-03
18:57
Create new branch named "fu-lib" check-in: 6703e22f7b user: saul tags: fu-lib
18:57
Ignore this branch named "fu-lib.scm" Closed-Leaf check-in: 38aac1784f user: saul
2014-01-09
01:36
Create new branch named "sg-alpha-to-svg-file" check-in: 68637c0508 user: saul tags: sg-alpha-to-svg-file
2014-01-02
19:10
Create new branch named "sg-process-layers" check-in: 23b79b0996 user: saul tags: sg-process-layers
2013-12-14
18:20
Create new branch named "fireanim" check-in: 165d30ddd5 user: saul tags: fireanim
2013-12-02
17:16
Create new branch named "sg-save-path-as-poly.scm" check-in: ac5ab91cc5 user: saul tags: sg-save-path-as-poly.scm
2013-11-24
16:12
Create new branch named "sg-3d-ify" check-in: 4a079c03bc user: saul tags: sg-3d-ify
2013-11-13
07:06
Create new branch named "sg-luminosity-masks" check-in: 1df9a40cf0 user: saul tags: sg-luminosity-masks
2013-09-17
16:43
Create new branch named "sg-kumar-kovuru" check-in: e5d1d3f8b3 user: saul tags: sg-kumar-kovuru
2013-07-16
04:21
Create new branch named "sg-pseudo-depth-map" check-in: fd9ac68f7e user: saul tags: sg-pseudo-depth-map
2013-07-06
23:12
Create new branch named "sg-dissolve-group" check-in: ed925e7d9c user: saul tags: sg-dissolve-group
2013-07-04
01:32
Create new branch named "sg-shadow-all-layers" check-in: 4a0fed20b2 user: saul tags: sg-shadow-all-layers
2013-06-24
17:06
Create new branch named "sg-copyright-symbol" check-in: 245b0ed848 user: saul tags: sg-copyright-symbol
2013-06-22
23:52
Create new branch named "sg-tone-map" check-in: 4a1b7f0f16 user: saul tags: sg-tone-map
2013-06-20
04:30
Create new branch named "sg-arrow-stroke-path" check-in: bbd0c9ad2b user: saul tags: sg-arrow-stroke-path
2013-06-06
12:04
Create new branch named "sg-snakes-and-ladders" check-in: 9b7689dfcd user: saul tags: sg-snakes-and-ladders
2013-05-23
16:58
Create new branch named "sg-merge-divide" check-in: 22b7b71c02 user: saul tags: sg-merge-divide
2013-05-17
08:55
Create new branch named "sg-borders" check-in: d9a8e61268 user: saul tags: sg-borders
2013-04-14
03:27
Create new branch named "sg-decomp-to-layers" Leaf check-in: 2b68df9d38 user: saul tags: sg-decomp-to-layers
2013-04-05
01:36
Create new branch named "sg-viktoria" check-in: 7c55465e6b user: saul tags: sg-viktoria
2013-02-26
03:24
Create new branch named "sg-hypmotized" check-in: 1d9e876332 user: saul tags: sg-hypmotized
2013-02-15
04:34
Create new branch named "sg-mtg-slate" check-in: 79331851cc user: saul tags: sg-mtg-slate
2013-01-06
04:07
Create new branch named "sg-save-histogram-info" Leaf check-in: 1db7b4bee5 user: saul tags: sg-save-histogram-info
2012-11-27
05:01
Create new branch named "sg-export-image-tree" check-in: d4928d0303 user: saul tags: sg-export-image-tree
2012-10-28
22:39
Create new branch named "sg-activity-log" Leaf check-in: 73552bb511 user: saul tags: sg-activity-log
22:30
Create new branch named "sg-logging" Leaf check-in: 996eb4f812 user: saul tags: sg-logging
2012-10-21
15:23
Create new branch named "sg-2d-packing" check-in: 4a7b7372f3 user: saul tags: sg-2d-packing
2012-10-14
12:14
Create new branch named "sg-hootyhoo" check-in: 080c78cad9 user: saul tags: sg-hootyhoo
2012-09-19
17:29
Create new branch named "sg-mgwalk-save" check-in: fbca1a5253 user: saul tags: sg-mgwalk-save
2012-09-12
22:25
Create new branch named "sg-photocomics" check-in: 8bc833a7f3 user: saul tags: sg-photocomics
2012-09-06
02:58
Create new branch named "sg-decompose" check-in: 5d6d26b662 user: saul tags: sg-decompose
2012-09-04
09:25
Create new branch named "sg-copy-mask" check-in: 6c15fb4db8 user: saul tags: sg-copy-mask
2012-09-03
17:40
Create new branch named "sg-apply-masks" check-in: 0066ab04c7 user: saul tags: sg-apply-masks
2012-08-22
11:15
Create new branch named "sg-multifill" check-in: e653d29bec user: saul tags: sg-multifill
2012-08-12
05:25
Create new branch named "sg-save-all-layers" check-in: cb9f750763 user: saul tags: sg-save-all-layers
2012-06-27
07:54
Fixed vertical justification (but 'bottom' may need some tweaking). Leaf check-in: c4201689f7 user: saul tags: LATEST, sg-goobie
07:06
Intermediate version which is overly complex and fails to handle centering/justification properly. check-in: e391f18e8e user: saul tags: sg-goobie
2012-06-13
05:28
Create new branch named "sg-goobie" check-in: ff12df0c63 user: saul tags: sg-goobie
05:24
Create new branch named "sg-create-badges" check-in: b2cbf306cc user: saul tags: sg-create-badges
2012-05-29
05:27
Create new branch named "sg-process-jpegs-in-folder" check-in: 876d582ad4 user: saul tags: sg-process-jpegs-in-folder
2012-05-21
23:01
Create new branch named "sg-dejw-paste" check-in: 8ea62d1137 user: saul tags: sg-dejw-paste
2012-04-15
16:04
Create new branch named "sg-numbered-frames.scm" check-in: 797f07925b user: saul tags: sg-numbered-frames.scm
2012-04-07
07:17
Create new branch named "sg-select-within-layer" check-in: 5ac83fffdf user: saul tags: sg-select-within-layer
2012-03-27
10:57
Create new branch named "sg-anim-settings" check-in: f244e32dc9 user: saul tags: sg-anim-settings
2012-02-28
02:31
Create new branch named "sg-copy-mask-from-above" check-in: c9985a274d user: saul tags: sg-copy-mask-from-above
2012-02-15
17:44
Create new branch named "sg-contour-fill" check-in: 008532b72c user: saul tags: sg-contour-fill
2012-02-06
20:45
Create new branch named "sg-zibbafy" check-in: f7ca57d139 user: saul tags: sg-zibbafy
2012-01-13
13:39
Create new branch named "sg-select-similar-colors" check-in: 37b920c537 user: saul tags: sg-select-similar-colors
2011-11-27
17:48
Create new branch named "sg-ornament-simple" check-in: a742ec8e81 user: saul tags: sg-ornament-simple
2011-11-06
13:32
Create new branch named "sg-channel-blend" check-in: c1ac254420 user: saul tags: sg-channel-blend
2011-10-16
04:28
Create new branch named "sg-expand-strip" check-in: 1f353fce5c user: saul tags: sg-expand-strip
2011-10-12
01:20
Create new branch named "sg-candlelit" check-in: 347f3d34ed user: saul tags: sg-candlelit
2011-09-27
09:23
Create new branch named "sg-tooninator" check-in: a6ce201c97 user: saul tags: sg-tooninator
2011-08-09
20:19
Create new branch named "sg-snapshot" check-in: 090f94d913 user: saul tags: sg-snapshot
2011-07-17
05:17
Create new branch named "sg-mystic-rose" check-in: 64f406315f user: saul tags: sg-mystic-rose
2011-07-12
05:01
Create new branch named "sg-panzoom" check-in: 285b349c70 user: saul tags: sg-panzoom
2011-07-11
18:12
Create new branch named "sg-incandescence". Leaf check-in: 11196fd42b user: saul tags: sg-incandescence
2011-05-10
20:28
Create new branch named "sg-quantize" check-in: 464add1ba1 user: saul tags: sg-quantize
2011-04-26
17:44
Create new branch named "sg-pattern-border" check-in: ead511acd2 user: saul tags: sg-pattern-border
2011-04-22
08:01
Create new branch named "sg-technicolor-3" check-in: a2013fa115 user: saul tags: sg-technicolor-3
2011-02-28
01:54
Create new branch named "sg-rotate-tab-labels" check-in: 1b53b0735f user: saul tags: sg-rotate-tab-labels
2011-02-25
22:34
Create new branch named "sg-mosaicize" check-in: 1a8a12053e user: saul tags: sg-mosaicize
2011-02-10
05:34
Create new branch named "sg-letter-drop" check-in: 51d381624d user: saul tags: sg-letter-drop
2011-02-01
03:07
Create new branch named "sg-projection-to-dodecahedron" check-in: 07340bd80e user: saul tags: sg-projection-to-dodecahedron
2011-01-27
20:43
Create new branch named "sg-extend-layer" check-in: 74915931aa user: saul tags: sg-extend-layer
2011-01-18
18:21
Create new branch named "sg-merge-linked" check-in: 938990b590 user: saul tags: sg-merge-linked
2011-01-09
16:49
Create new branch named "sg-dodecalendar" Closed-Leaf check-in: 69860bfec9 user: saul
2010-12-28
16:58
Create new branch named "sg-calendar-year" check-in: cc9615ab14 user: saul tags: sg-calendar-year
00:24
Create new branch named "sg-calendar" check-in: 74bb511193 user: saul tags: sg-calendar
2010-12-14
23:48
Create new branch named "sg-combine-bg" check-in: 4d56aac507 user: saul tags: sg-combine-bg
2010-12-04
14:57
Create new branch named "sg-fit-face" check-in: 366a3d12e8 user: saul tags: sg-fit-face
2010-11-14
22:16
Create new branch named "sg-colorcube" check-in: 08198c0bd5 user: saul tags: sg-colorcube
2010-11-13
15:17
Create new branch named "sg-damien" check-in: 47fd9604dd user: saul tags: sg-damien
2010-11-12
05:38
Create new branch named "sg-histogram-hue" check-in: 1be57e8b83 user: saul tags: sg-histogram-hue
2010-11-02
11:17
Create new branch named "sg-mean-fill" check-in: 0248a1f958 user: saul tags: sg-mean-fill
2010-10-25
10:39
Create new branch named "sg-layer-fit-to-selection" check-in: 08b6529ec0 user: saul tags: sg-layer-fit-to-selection
2010-10-02
14:26
Create new branch named "sg-gradient-survey" check-in: 587a076fe0 user: saul tags: sg-gradient-survey
2010-09-18
09:36
Create new branch named "sg-mirror-dup" check-in: b6ac506cba user: saul tags: sg-mirror-dup
2010-08-16
05:08
Create new branch named "sg-sudoku" check-in: 4a90bcc680 user: saul tags: sg-sudoku
2010-08-05
04:47
Create new branch named "sg-align-down" check-in: 4de83f17ac user: saul tags: sg-align-down
02:25
Create new branch named "sg-warptext" check-in: e2e125da6a user: saul tags: sg-warptext
2010-07-28
23:11
Create new branch named "sg-scale-to-selection" check-in: 3c68259dfc user: saul tags: sg-scale-to-selection
23:08
Create new branch named "sg-isolate" check-in: 9685296eac user: saul tags: sg-isolate
22:52
Create new branch named "sg-anti-crop" check-in: d8e79744c5 user: saul tags: sg-anti-crop
22:48
Added empty file. check-in: b2436f229b user: saul tags: trunk
13:29
initial empty check-in check-in: cf23bd898b user: saulgoode tags: trunk, root

Added example.data.







































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
; Example file for script-fu-sg-goobie.scm
; The script should be invoked from an image
; that contains layers with the following names

( athlete-name club-name athlete-number uniform-color )

; Next comes the data entries for each of the athletes.
;
 ("Kyle" "Manchester United" "21" "red")
 ("Kenny" "Chelsea" "4" "red")
 ; date entries can be spread across lines (white space is ignored)
 ("Stan"  
   "Arsenal" 
   "15" 
   "blue" )
 ("Token" ; comments can be interspersed with data
   "Liverpool" ; following Scheme syntax.
   "11" 
   "black" )

Added sg-goobie.scm.



















































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
; GNU General Public License for more details.

; This script reads in a data file containing a list of 
; team members' names and associated information. For each person listed
; in the data file, an XCF file is produced incorporating the data
; into a master template image.

; The data file uses Lisp/Scheme style lists and commenting (comments
; start with a semi-colon and extend to the end of the line).

; The first non-comment line of the data file should be a list containing
; the field names of the player information wrapped in parentheses.
; For example:
;
;   ; THIS IS A COMMENT AND IGNORED
;   ( athlete-name club-name athlete-number uniform-color )
;
; This "header" list should be followed by the lists containing the 
; actual data to be substituted into the template file. The data should
; be text strings and appear in the same order as the fields specified in 
; the header list.
;
; ("Kyle" "Manchester United" "21" "red")
; ("Stan"  "Arsenal" "15" "blue")
; ("Kenny" "Chelsea" "4" "red")
; ("Token" "Liverpool" "11" "black")
;
;
; The currently open image is used as a template with the upper layers having
; names that match the field names. These field layers are used to determine 
; the location and size of the text (this layer is otherwise ignored). 
; The name text is centered within the bounds of this field template layer.
;
;
(define (script-fu-sg-goobie image 
                             datafilename 
                             save-xcf
                             save-jpeg
                             save-png
                             save-dir 
                             vert-justification 
                             size-handling)

  ;; Perform a search for the largest font that will fit within
  ;; the cell.
  ;
  (define (calc-fontsize text font width height)
    (let loop ((fontsize 6) ;; minimum possible fontsize
               (last-extents nil)
               (last-fontsize 3)
               (adjust 2)        
               )
      (let ((extents (gimp-text-get-extents-fontname text fontsize PIXELS font)))
        (if (or (= last-fontsize fontsize) (equal? extents last-extents))
          (max fontsize 6)
          (if (or (> (car extents) width) (> (cadr extents) height))
            (loop (truncate (* last-fontsize (+ (* (- adjust 1) 0.5) 1)))
                  last-extents
                  last-fontsize
                  (+ (* (- adjust 1) 0.5) 1) )
            (loop (truncate (* fontsize adjust))
                  extents
                  fontsize 
                  adjust ))))))
                                
  (define (create-data-layer image field-name field-data)
    (let ((frame-layer 
             (let loop ((layers (vector->list (cadr (gimp-image-get-layers image)))))
               (if (null? layers)
                 #f
                 (if (string=? field-name (car (gimp-drawable-get-name (car layers))))
                   (car layers)
                   (loop (cdr layers)) )))))
      (if frame-layer
        (if (= (car (gimp-drawable-is-text-layer frame-layer)) 1)
          (let ((x (car (gimp-drawable-offsets frame-layer)))
                (y (cadr (gimp-drawable-offsets frame-layer)))
                (w (car (gimp-drawable-width frame-layer)))
                (h (car (gimp-drawable-height frame-layer))) 
                (font (car (gimp-text-layer-get-font frame-layer)))
                (size (car (gimp-text-layer-get-font-size frame-layer)))
                )
            (gimp-image-set-active-layer image frame-layer)
            (gimp-text-layer-set-text frame-layer field-data)
            (let ((extents (gimp-text-get-extents-fontname field-data
                                                           size
                                                           PIXELS 
                                                           font )))
              (when (and (zero? size-handling)
                         (or (> (car extents) w)
                             (> (cadr extents) h) ))
                (gimp-text-layer-set-font-size frame-layer (calc-fontsize field-data font w h) PIXELS) )
              (case vert-justification 
                ((0) ; center
                  (gimp-layer-set-offsets frame-layer
                                          x
                                          (+ y (/ (- h (cadr extents)) 2)) ))
                ((1) ; top
                  (gimp-layer-set-offsets frame-layer
                                          x
                                          y ))
                ((2) ; bottom
                  (gimp-layer-set-offsets frame-layer
                                          x
                                          (- (+ y h) (cadr extents)) )))))
          (gimp-message "Field layer is not a text layer")
          )
        (begin
          (gimp-message (string-append "Field layer not found: " field-name)) ))
      frame-layer ))
    
  ;; ----------------------------------------------------------------------
  ;; Main processing start here
  ;
  (let* ((inport (open-input-file datafilename))
         (field-names (map symbol->string (read inport)))
         (filetag (car field-names)) )
    (gimp-image-undo-freeze image)
    (gimp-context-push)
    (let entry-loop ((fields (read inport)))
      (unless (eof-object? fields)
        (let ((temp-image (car (gimp-image-duplicate image)))
              (filename #f) )
          (let field-loop ((field-names field-names)
                           (field-values fields) )
            (unless (null? field-values)
              (when (string=? (car field-names) filetag)
                (set! filename (car field-values)) )
              (create-data-layer temp-image (car field-names) (car field-values))
              (field-loop (cdr field-names) (cdr field-values)) ))
          (if filename
            (let ((fullname (string-append save-dir 
                                           DIR-SEPARATOR 
                                           filename )))
              (unless (zero? save-xcf)
                (let ((filename (string-append fullname ".xcf")))
                  (gimp-xcf-save TRUE
                                 temp-image 
                                 (car (gimp-image-get-active-layer image))
                                 filename
                                 filename )))
              (unless (zero? save-png)
                (let ((layer (car (gimp-image-merge-visible-layers temp-image 
                                                                   CLIP-TO-IMAGE )))
                      (filename (string-append fullname ".png")) )
                  (file-png-save2 RUN-NONINTERACTIVE 
                                  temp-image 
                                  layer
                                  filename 
                                  filename 
                                  FALSE ; interlace
                                  9
                                  FALSE ; bkgd
                                  (car (gimp-drawable-has-alpha layer))
                                  FALSE ; offs
                                  FALSE ; phys
                                  FALSE ; time
                                  TRUE  ; comment
                                  FALSE ; svtrans
                                  )))
              (unless (zero? save-jpeg)
                (let ((layer (car (gimp-image-flatten temp-image)))
                      (filename (string-append fullname ".jpg")) )
                  (file-jpeg-save RUN-NONINTERACTIVE 
                                  temp-image 
                                  layer
                                  filename 
                                  filename 
                                  0.93
                                  0 ; smoothing 
                                  1 ; optimize 
                                  1 ; progressive 
                                  "" ; comment 
                                  0 ; subsmp (0-4)
                                  1 ; baseline 
                                  0 ; restart 
                                  0 ;dct 
                                  ))))
            (gimp-message "Error encountered") )
          ; (gimp-image-delete temp-image)
          )
        (entry-loop (read inport)) ))
    (close-input-port inport) 
    (gimp-context-pop)
    (gimp-image-undo-thaw image)
    )
  )
    
        
(script-fu-register "script-fu-sg-goobie"
 "Goobie (uniforms)..."
 "Create uniform files based on template image"
 "Saul Goode"
 "Saul Goode"
 "June 2012"
 "*"
 SF-IMAGE "Image" 0
 SF-FILENAME    "Data file" "example.data"
 SF-TOGGLE "Save as XCF" FALSE
 SF-TOGGLE "Save as JPEG" TRUE
 SF-TOGGLE "Save as PNG" FALSE
 SF-DIRNAME "Save directory" ""
 SF-OPTION "Vertical justification" '("Center" "Top" "Bottom")
 SF-OPTION "Font sizing (if too large)" '("Fit" "Crop" "Overflow")
 )
(script-fu-menu-register "script-fu-sg-goobie"
  "<Image>/File"
  )