Re: Why doesn't GTK+ use RLE for the stock icons?



On 29 Jul 2002, Sven Neumann wrote:

> Hi,
> 
> I have written:
> 
> > is there any good reason why GTK+ explicitely uses the --raw option
> > when calling gdk-pixbuf-csource to create inline versions of the stock
> > icons? Removing the --raw command-line flag makes gdk-pixbuf-csource
> > use run-length-encoding and reduces the size of the stripped library
> > by 91kB. This isn't too much but nevertheless a 4% saving in disk
> > space which we'd get all for free by using the existing technology.
> 
> oh, I think I've found the answer myself in the GTK+ documentation:
> 
>   GTK+ ships with a program called gdk-pixbuf-csource which allows for
>   conversion of GdkPixbufs into such a inline representation. In
>   almost all cases, you should pass the --raw flag to
>   gdk-pixbuf-csource. For the typical case where the inline pixbuf is
>   read-only static data, you don't need to copy the pixel data unless
>   you intend to write to it, so you can pass FALSE for copy_pixels.
>   (If you pass --rle to gdk-pixbuf-csource, a copy will be made even
>   if copy_pixels is FALSE, so using this option is generally a bad
>   idea.)
> 
> So, using the --rle flag probably only makes sense if disk-space is
> very low.

the documentation makes a bad recommendation with "in almost all cases".
for libraries (like gtk) it's probably better to use --raw to save local
runtime copies of the images in every application that uses the library.
however, for applications that come with lots of pixmaps, but doesn't
display the majority thereof at a single point in time, and for huge
images like splash screens, rle provides significant savings which
shouldn't be discarded just because the docs present a limited library
centric view point only.

> Salut, Sven
> 

---
ciaoTJ




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