Details Ticket 2811


Comment | Reply | Take | Open


Serial Number 2811
Subject display/drivers/PNG/description.html default GRASS_PNG_COMPRESSION
Area grass6
Queue grass
Requestors jidanni@jidanni.org
Owner none
Status resolved
Last User Contact Thu Sep 28 16:10:06 2006 (2 yr ago)
Current Priority 30
Final Priority 70
Due No date assigned
Last Action Thu Sep 28 16:10:06 2006 (2 yr ago)
Created Wed Dec 8 00:03:11 2004 (4 yr ago)

Transaction History Ticket 2811


Wed, Dec 8 2004 00:03:11    Request created by jidanni@jidanni.org  
Return-Path <jidanni@jidanni.org>
Delivered-To grass-bugs@lists.intevation.de
To grass-bugs@intevation.de
Subject display/drivers/PNG/description.html default GRASS_PNG_COMPRESSION
From Dan Jacobson <jidanni@jidanni.org>
Date Wed, 08 Dec 2004 00:16:16 +0800
Message-ID <873byiulrj.fsf@jidanni.org>
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
X-Spam-Status No, hits=-4.2 tagged_above=-999.0 required=3.0 tests=BAYES_00, DATE_IN_PAST_06_12, UPPERCASE_25_50
X-Spam-Level
In display/drivers/PNG/description.html,
     * GRASS_PNG_COMPRESSION=[0|1|9]
       compression level of PNG files (0 = none, 1 = fastest, 9 = best)
Mention default=what?


Wed, Dec 8 2004 14:33:27    Mail sent by mneteler  
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");

grep PNG_COMPRESSION_TYPE_DEFAULT *
write.c:                PNG_COMPRESSION_TYPE_DEFAULT,

grep PNG_COMPRESSION_TYPE_DEFAULT /usr/include/png.h
#define PNG_COMPRESSION_TYPE_DEFAULT PNG_COMPRESSION_TYPE_BASE

grep PNG_COMPRESSION_TYPE_BASE /usr/include/png.h
   png_byte compression_type; /* must be PNG_COMPRESSION_TYPE_BASE (IHDR) */
#define PNG_COMPRESSION_TYPE_BASE 0 /* Deflate method 8, 32K window */
#define PNG_COMPRESSION_TYPE_DEFAULT PNG_COMPRESSION_TYPE_BASE

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

Markus
Thu, Dec 9 2004 23:09:25    Mail sent by glynn@gclements.plus.com  
Return-Path <glynn@gclements.plus.com>
Delivered-To grass-bugs@lists.intevation.de
From Glynn Clements <glynn@gclements.plus.com>
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
Message-ID <16824.52466.218193.941312@cerise.gclements.plus.com>
Date Thu, 9 Dec 2004 22:08:50 +0000
To Markus Neteler via RT <grass-bugs@intevation.de>
Cc jidanni@jidanni.org, grass5@grass.itc.it
Subject Re: [GRASS5] [bug #2811] (grass) display/drivers/PNG/description.html default GRASS_PNG_COMPRESSION
In-Reply-To <20041208133327.C5067102BFC@lists.intevation.de>
References <20041208133327.C5067102BFC@lists.intevation.de>
X-Mailer VM 7.17 under 21.4 (patch 15) "Security Through Obscurity" XEmacs Lucid
X-Spam-Status No, hits=-4.8 tagged_above=-999.0 required=3.0 tests=BAYES_00, HTML_MESSAGE
X-Spam-Level
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@gclements.plus.com>


Mon, Dec 12 2005 11:55:35    Area changed to grass6 by msieczka  
Fri, Aug 4 2006 02:37:20    Comments added by guest  
Cc: tutey@o2.pl

So what is the default compression level in the png library? The snippet you
posted didn't actually mention what it was, just that it uses its default
value, which is never stated.

~ Eric.
<epatton at nrcan dot gc dot ca>
Tue, Sep 26 2006 21:31:07    Mail sent by guest  
From the png library manual (http://www.libpng.org/pub/png/libpng-manual.txt)
<snip>
Libpng uses zlib for its compression and decompression of PNG files.
Further information about zlib, and the latest version of zlib, can
be found at the zlib home page, <http://www.info-zip.org/pub/infozip/zlib/>.
The zlib compression utility is a general purpose utility that is
useful for more than PNG files, and can be used without libpng.

<snip>

Configuring zlib:

There are special functions to configure the compression.  Perhaps the
most useful one changes the compression level, which currently uses
input compression values in the range 0 - 9.  The library normally
uses the default compression level (Z_DEFAULT_COMPRESSION = 6).  Tests
have shown that for a large majority of images, compression values in
the range 3-6 compress nearly as well as higher levels, and do so much
faster.

So it looks like the default compression level is set to 6 if
$GRASS_PNG_COMPRESSION is not set.

Maciek, can we close this one?

~ Eric.

Thu, Sep 28 2006 13:38:25    Mail sent by msieczka  
Good research Eric. Could you maybe update the doc in question and post the
patch to me?

Thanks,
Maciek
Thu, Sep 28 2006 14:40:24    Mail sent by epatton@nrcan.gc.ca  
Return-Path <epatton@nrcan.gc.ca>
Delivered-To grass-bugs@lists.intevation.de
Message-ID <0E5A77B55A57D511BB3F0002A537C26208C55B9C@s5-dar-r1.nrn.nrcan.gc.ca>
From "Patton, Eric" <epatton@nrcan.gc.ca>
To 'Maciek Sieczka via RT ' <grass-bugs@intevation.de>
Subject RE: [bug #2811] (grass) display/drivers/PNG/description.html defa ult GRASS_PNG_COMPRESSION
Date Thu, 28 Sep 2006 09:40:13 -0300
MIME-Version 1.0
X-Mailer Internet Mail Service (5.5.2657.72)
x-originalarrivaltime <rt@intevation.de>
x-warning <rt@intevation.de>
x-whitelist <rt@intevation.de>
x-envelope-from <rt@intevation.de>
x-envelope-to <rt@intevation.de>
x-sender <rt@intevation.de>
x-request-id <rt@intevation.de>
x-rt-loop-prevention <rt@intevation.de>
x-managed-by <rt@intevation.de>
Content-Type text/plain; charset="iso-8859-1"
X-Virus-Scanned by amavisd-new at intevation.de
X-Spam-Status No, hits=-5 tagged_above=-999 required=3 tests=[BAYES_00=-5]
X-Spam-Level
Sure. I think it's one of the Grass site webpages that needs to be updated.
I should be able to get this done today.

~ Eric. 

-----Original Message-----
From: Maciek Sieczka via RT
To: jidanni@jidanni.org
Cc: Patton, Eric
Sent: 9/28/2006 7:38 AM
Subject: [bug #2811] (grass) display/drivers/PNG/description.html default
GRASS_PNG_COMPRESSION

Good research Eric. Could you maybe update the doc in question and post
the
patch to me?

Thanks,
Maciek


-------------------------------------------- Managed by Request Tracker


Thu, Sep 28 2006 16:10:06    Status changed to resolved by msieczka  
Thu, Sep 28 2006 16:10:06    Mail sent by msieczka  
Closing it. Thanks Eric!

Maciek
Comment | Reply | Take | Open

You are currently authenticated as guest.
[Show Configuration] [Login as another user]

Users Guide - Mail Commands - Homepage of RequestTracker 1.0.7 - list any request