[cairo] [PATCH] Enable links to image files in SVG backend
cworth at cworth.org
Wed Jan 20 03:50:15 PST 2010
On Wed, 20 Jan 2010 10:59:20 +0000, Chris Wilson <chris at chris-wilson.co.uk> wrote:
> On Wed, 20 Jan 2010 12:43:12 +0200, Alexander Shulgin <alex.shulgin at gmail.com> wrote:
> > But I don't buy people use png loader only for debugging purposes.
> > It's so sweet and simple and tempting to use as opposed to libpng, and
> > it's never been claimed "debugging only" API, at least in the docs
> > (what users read actually).
> Exactly the same trap as cairo_show_text(). :(
I don't think it's a trap, (nor do I think of this as "debugging only"
API). Sure, when we find people using these, we tell them how to do
something better, (maposmatic is now switching to pango in order to get
RTL text to work). But I do think it's great that people are able to get
at least *something* working (even if not ideally) without having to
read the documentation for three different libraries potentially getting
lost or frustrated and then giving up.
> > If user calls set_mime_data() explicitly, I'm OK with that, and he's
> > on his own. But when we call it for him and he has no idea, I think
> > it's broken.
> It's a convenience API, primarily for loading pattern data, so I see
> attaching the mime-data as part of that convenience.
It's a convenience API, but it can be used for loading an image on which
to draw annotations just as easily as loading pattern data.
The current behavior of the call to cairo_surface_set_mime_data inside
there is clearly a bug. Removing the call would fix the bug, but would
eliminate this aspect of convenience (as you mention).
The other option to fix the bug (without losing the convenience here)
would be to clear the mime data when a surface is modified. This would
make the data more consistent, certainly. It would mean that users would
have to be careful about the timing of calling
cairo_surface_set_mime_data. I can't (at the moment) think of a
situation where an application wouldn't have the flexibility to just
call that at the correct time.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20100121/e57ebc1b/attachment.pgp
More information about the cairo