On Tue, Feb 10, 2009 at 6:58 PM,
<saulgo...@flashingtwelve.brickfilms.com> wrote:
> Quoting Decimator Doseven <decimator...@yahoo.com>:
>
>> I am attempting to set up a batch that automatically runs
>> gimp-curves-spline on a set of images.  However, I have never used
>> Scheme before and therefore am not sure why my script is returning
>> "batch command experienced an execution error"
>> :
>> :
>> (gimp-curves-spline RUN-NONINTERACTIVE image
>> HISTOGRAM-VALUE 3 '(0 0 64 200 128 46))
>
> Unfortunately, you cannot just pass a list of values to the
> 'gimp-curves-spline' PDB function; you must pass that list as an array
> of 8-bit values.
>
> You can create such an array with code similar to the following
>
>   (let* (
>       (my-curve (cons-array 6 'byte))
>       )
>     (aset! my-curve 0 0)
>     (aset! my-curve 1 0)
>     (aset! my-curve 2 64)
>     (aset! my-curve 3 200)
>     (aset! my-curve 4 128)
>     (aset! my-curve 5 46)
>     (gimp-curves-spline RUN-NONINTERACTIVE image
>                         HISTOGRAM-VALUE 3 my-curve)
>     )
>


Maybe byte-arrays where stored differently in earlier versions (I do
not know), but it seems to me they are stored as vectors in GIMP
2.6.4, so is there any reason not use a literal vector (as in #(0 0 64
200 128 46)):

(equal? #(0 0 64 200 128 46)
          (let ((my-curve (cons-array 6 'byte)))
            (aset my-curve 0 0)
            (aset my-curve 1 0)
            (aset my-curve 2 64)
            (aset my-curve 3 200)
            (aset my-curve 4 128)
            (aset my-curve 5 46)))

=> #t

Just wondering,
Niels.
_______________________________________________
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user

Reply via email to