Re: pictures



On Tue, 2011-02-15 at 12:42 +0100, Benjamin Otte wrote:
> On Tue, Feb 15, 2011 at 8:45 AM, Alexander Larsson <alexl redhat com> wrote:
> > The height/width stuff makes this very much a pixel-storage-based kind
> > of picture, and doesn't ideally describe a vectorized image, like say an
> > svg, where there might be no "natural" size in terms of pixels.
> >
> > How do you intend to handle these? (Just pretend that they have some
> > size is one answer, I'm just wondering if you've thought about this
> > case.)
> >
> The same way gdk-pixbuf does it essentially: Allow you to specify a
> size and if you don't, use the most natural one. I'm probably also
> gonna at a ResizablePicture interface and implement it in the SVG
> loader so that you can live-resize an SVG that you loaded.

Allowing true resize like that implies keeping all svg data around (+
probably pixels for fast rendering). Perhaps something like that is
better done at load time, or at least make saving the data optional?

> I thought a bit about allowing unsized pictures, but it didn't make
> sense to me. First, from looking at the librsvg API, it seemed to me
> that its developers try very hard to force a size on the SVG, even if
> there is none. Second, you need a size for interacting with a toolkit
> so that the toolkit can layout its window according to the size. (From
> the SVG perspective, this is very different from web or print. There,
> a size is predefined and you fill it as best as you can. Smething like
> width=100% would not make sense in GTK for example.)

Most actual images do have a natural size they are designed for, since
in practice you can't just scale images and get something useful at
wildly different sizes. Its just that the size might be in some physical
units rather than in pixels. So, how to pick the pixel size depends on
the destination characteristics (the dpi).

It would be nice to have some sort of "late binding" of the size so that
the pixel size is determined when the picture is rendered. 

Maybe thats kinda weird. But at the very least it would be nice to have
a way for the loader to specify natural physical sizes during loading so
that you can pick the right pixel size based on the expected destination
dpi.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
       alexl redhat com            alexander larsson gmail com 
He's a witless one-eyed shaman on the edge. She's a transdimensional 
cigar-chomping bounty hunter with someone else's memories. They fight crime! 



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