Raphael wrote:
> On Wed, 06 Feb 2002, Dave Neary wrote:
>  > Where *is* the list of parasites? There are only (as you point
out)
>  > about 10 persistent parasites, and the list isn't maintained
anywhere.
>
> OK, so now the problem is clear: we need a way to enforce some
> consistency for the names of the parasites in the standard namespace
> ("gimp-*").

Agreed (if we decide to go for multiple parasites, and it seems like
I'm
becoming outgunned). We should also work out whether what we've
been talking about is exif, to the exclusion of other metadata, or
generic
metadata, which would include exif data as a subset.


> Maybe we could also define
> the "exif-*" namespace as common, although it could also be
> "gimp-exif-*".  Any plug-in that attempts to set or get a "gimp-*"
> parasite that has not been defined in some central place should
cause
> the core to generate some kind of warning.

If we go with the more generic "metadata" option, then we would have
the option of gimp-metadata-*. But that's minutiae at the moment.

> So, what about this solution: I convert the existing list of common
> parasites (only the "gimp-*" parasites in devel-docs/parasites.txt)
to
> a list of strings that can be put in a *.c or *.h file.  I also add
> the EXIF data to this list.  Then if the GIMP is compiled in debug
> mode, I would add some code in the PDB functions for accessing the
> parasites.  This code would trigger a g_warning if the name of a
> "gimp-*" parasite cannot be found in the pre-compiled list.

A parasite validator would certainly be a solution. The question would
then be whether the overhead of validating every parasite request
would
outweigh the overhead of parsing one metadata object :-)

> The code could also check the type of the parasite automatically,
but
> this would imply an API change for all PDB functions dealing with
> parasites and that would also require an upgrade of the XCF format.
> So this would break a lot of things, but maybe it is better to do it

> as early as possible.  Any opinions on this?

Well, XCF was due an upgrade, but backward compatibility is a
concern...

> Note that the *.c or *.h file containing the list of common
parasites
> in the "gimp-*" namespace could be generated at build time from an
XML
> file.  That file could also hold the human-readable documentation of
> these parasites and it could be used to generate a text file or HTML
> file documenting the common parasites.

Sounds like a plan.

> The usage of non-standard parasites has not been a problem so far.
> All authors of plug-ins have correctly followed the guidelines
> described in devel-docs/parasites.txt.  From that point of view, I
do
> not think that it is really important to add a mechanism that checks
> if the "gimp-*" namespace is used correctly.  But I think that it
> could be a nice addition, so I will see what I can do about it until
> next week.

That's primarily because the use of parasites has been limited to a
few -
notably gimp-comment. Apart from 3/4 commonly used parasites it
hasn't come up. If we're passing image metadata around a lot it'll
certainly be more of a concern.

But we're getting towards agreement. I'm still not convinced that
that's the way to go, but I can see that it's certainly at least as
workable as my suggestion :)

Cheers,
Dave.


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

Reply via email to