Marc Lehmann writes:
 > no, but I have this (this is what I originally used on tehe fair), it
 > comverts all *tub-files given as arguments to .gih-files.
 > 
 > perl -MGimp -e 'Gimp::init; Gimp::set_trace(-1); for(@ARGV) { \
 >                 my $img = Gimp->file_load(($_)x2); s/.tub$/.gih/; \
 >                 $img->get_active_layer->file_gih_save(($_)x2, 100, $_); \
 >                 $img->delete }' *.tub

I just committed an implementation for the non-interactive
file_gih_save. Dunno how it should be called from Perl, but in
script-fu it goes like this, for example:

  (let ((ranks (cons-array 1 'byte)))
    (aset ranks 0 12)
    (file-gih-save 1
                   img
                   drawable
                   "foo.gih"
                   "foo.gih"
                   100
                   "test brush"
                   125
                   125
                   3
                   4
                   1
                   ranks
                   1
                   '("random")))

Obviously, this is not quite what you have in mind. Passing in all the
parameters is not what you want to do, as you are saving an image that
has been loaded from a .tub file and thus has the
gimp-brush-pipe-parameters parasite set up already, containing the
necessary information. Should the args be ignored in such a case? Or
should there be a separate PDB function,
file_gih_save_using_parameters_from_parasite or something? I assume
PDB args can't be optional?

--tml

Reply via email to