David Neary <[EMAIL PROTECTED]> writes:

> Sven Neumann wrote:
> > 
> > Hi,
> > 
> > Gordon Royle <[EMAIL PROTECTED]> writes:
> > 
> > > What is the format of the GIMP gradient files?
> > 
> > this routine saves the gradient. You should be able to determine the
> > format from this info:
> 
> <snip routine>
> 
> Really? In 1.2, it appears to be this...
> 
>   fprintf (file, "%d\n", num_segments);
> 
>   for (seg = grad->segments; seg; seg = seg->next)
>     fprintf (file, "%f %f %f %f %f %f %f %f %f %f %f %d %d\n",
>              seg->left, seg->middle, seg->right,
>              seg->r0, seg->g0, seg->b0, seg->a0,
>              seg->r1, seg->g1, seg->b1, seg->a1,
>              (int) seg->type, (int) seg->color);
> 
> Why the huge change?

I don't see any change in the file format except the following:

In GIMP 1.3, gradients have an extension ".ggr" and don't encode
thair name in the filename anymore but inside the .ggr file:

GIMP Gradient
Name: Abstract 1
6
0.000000 0.286311 0.572621 0.269543 0.259267 1.000000 1.000000 0.215635 0.407414 
0.984953 1.000000 0 0
0.572621 0.657763 0.716194 0.215635 0.407414 0.984953 1.000000 0.040368 0.833333 
0.619375 1.000000 0 0
0.716194 0.734558 0.749583 0.040368 0.833333 0.619375 1.000000 0.680490 0.355264 
0.977430 1.000000 0 0
0.749583 0.784641 0.824708 0.680490 0.355264 0.977430 1.000000 0.553909 0.351853 
0.977430 1.000000 0 0
0.824708 0.853088 0.876461 0.553909 0.351853 0.977430 1.000000 1.000000 0.000000 
1.000000 1.000000 0 0
0.876461 0.943172 1.000000 1.000000 0.000000 1.000000 1.000000 1.000000 1.000000 
0.000000 1.000000 0 0

Which is still so ugly that i think we should never allow the new
format to become used, but port it to a GimpConfig style format:

<proposal>
# GIMP Gradient file

(GimpGradient "Abstract 1"
        (segment 0.000000 0.286311 0.572621
                (left-color (gimp-rgba 0.269543 0.259267 1.000000 1.000000))
                (right-color (gimp-rgba 0.215635 0.407414 0.984953 1.000000))
                (blending-function linear)
                (coloring-type rgb))
        (segment ...)
        ...
        (segment ...))
</proposal>

Of course, GIMP would continue to read the old files.

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

Reply via email to