Re: [Gimp-developer] Gimp Plug-in for Retrieving Text Layers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




This is a response to the "Why would you need to have the text?"  

Well, when writing a filter to save a file, or generate a file set.  Some old IBM
file formats allow you to optimize your image with text objects and "rules"
(horizontal or vertical lines).  If I could determine the text content, I could
generate a very small and optimized file.

Also, file formats such as wmf, postscript, pdf and such benefit from
vector based information and text information.

I guess, my thought would be for widget implementers, to abide by
certain rules, with the raster based image being the common
denominator.  So, "Text" tools, should implement the "GimpText"
object.  "Curve Editors" should implement their counterpart.  This
way, enumeration of layers and content would yield good information
(not great) for exporting in specific file formats.

Gimp is great tool, could be a start to more than photo's and images, a
whole world of "document management" could be assisted by this :)

This is all just my opinion.

Thanks

Bill


Sven Neumann <neo@xxxxxxxxxxxxxxxxxxxxx> wrote on 12/02/2004 05:50:58 AM:

> Hi,
>
> David Neary <dneary@xxxxxxx> writes:
>
> > Not really - the usual way is to do something like this:
> >
> > gint nlayers, i;
> > gint *layers = gimp_image_get_layers(image_id, &nlayers);
> > /* layers[0] is the top layer */
> >
> > for (i = 0; i < nlayers; i++)
> > {
> >   /* Do stuff with layers[i] */
> >   /* layer is a text layer if the parasite "gimp-text-layer" has been
> >    * set */
> >   GimpDrawable *layer = gimp_drawable_get (layers[i]);
> >   GimpParasite *text_parasite = gimp_drawable_parasite_find
> >                                   (layers[i], "gimp-text-layer");
> >   if (text_parasite != NULL)
> >     /* We have a text layer */
> >  
> > }
>
> OK, now I will have to kill you both. Well, perhaps not but I can only
> strongly discourage to do it this way. You must not rely on the text
> parasite and it's content.  Doing this might to some extent work on
> XCF files that have been freshly loaded but it will fail as soon as a
> text layer is modified. There is also no guarantee that this behaviour
> won't change in future versions of GIMP. I might even decide to change
> it in the middle of a stable release cycle. Perhaps even for the only
> reason to break your code that should not be doing this.
>
>
> Sven

[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux