[GRASS5] [bug #2811] (grass) display/drivers/PNG/description.html default GRASS_PNG_COMPRESSION

Glynn Clements glynn at gclements.plus.com
Thu Dec 9 17:08:50 EST 2004


Markus Neteler via RT wrote:

> Here related details:
> 
> cd grass57/display/drivers/PNG/
> grep GRASS_PNG_COMPRESSION *
> description.html:  <LI><B>GRASS_PNG_COMPRESSION=[0|1|9]</B><BR>
> write.c:        str = getenv("GRASS_PNG_COMPRESSION");

[snip]

> ... still no idea what to add to the HTML page.

The GRASS_PNG_COMPRESSION environment variable determines the level of
compression, with 0 being no compression and 9 being maximum
compression. If unset, the PNG library's default compression level
will be used.

The documentation for that function in png.h says:

  /* Set the library compression level.  Currently, valid values range from
   * 0 - 9, corresponding directly to the zlib compression levels 0 - 9
   * (0 - no compression, 9 - "maximal" compression).  Note that tests have
   * shown that zlib compression levels 3-6 usually perform as well as level 9
   * for PNG images, and do considerably fewer caclulations.  In the future,
   * these values may not correspond directly to the zlib compression levels.
   */
  extern PNG_EXPORT(void,png_set_compression_level) PNGARG((png_structp png_ptr,
     int level));

Note: the PNG_COMPRESSION_TYPE_* stuff isn't relevant. It's present in
write.c because one of the required parameters to png_set_IHDR() is
the compression type, but PNG only actually understands one
compression type.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list