;;;
;;;  break-gimp.scm - Crash on big palettes for Sven
;;;
;;;
;;;  Jeff Trefftzs <[EMAIL PROTECTED]>

;;; 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.
;;; 
;;; You should have received a copy of the GNU General Public 
License
;;; along with this program; if not, write to the Free Software
;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

;;; Define the function:

(define (script-fu-break-gimp inImage inLayer inPalette)

  (gimp-undo-push-group-start inImage)

;; Real work goes in here

  (gimp-convert-indexed inImage
                          0             ; No dithering, since we want pixelized
                          CUSTOM-PALETTE ; create our own palette to start
                          32            ; using specified no of colors
                          FALSE         ; No alpha dither
                          FALSE         ; Remove unused colors
                          inPalette)    ; Ignored this time

  (gimp-image-set-active-layer inImage inLayer)
  (gimp-undo-push-group-end inImage)
  (gimp-displays-flush)
)

(script-fu-register
 "script-fu-break-gimp"
 _"<Image>/Script-Fu/TEST/Break Gimp with big palette."
 "Makes GIMP segfault."
 "Jeff Trefftzs"
 "Copyright 2002, Jeff Trefftzs"
 "February 3, 2002"
 "RGB*"
 SF-IMAGE "The Image" 0
 SF-DRAWABLE "The Layer" 0
 SF-FILENAME "The Palette" "Named_Colors"
 )

On a pure white image, it just seemed to go into a loop; on an 
image with a colored gradient it gave multiple segfaults and 
then crashed.

YMMV.


-- 
--Jeff

Jeff Trefftzs <[EMAIL PROTECTED]>
http://www.tcsn.net/trefftzs                    Home Page
http://gug.sunsite.dk/gallery.php?artist=68     Gimp Gallery
http://trefftzs.topcities.com/home.html         Photo galleries





_______________________________________________
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer

Reply via email to