Return-Path: <tiff-bounces@lists.maptools.org>
X-Original-To: info@awaresystems.be
Delivered-To: info@awaresystems.be
Received: from mx-k.b-one.net (mx-k.one.com [91.198.169.58])
	by mail9.b-one.net (Postfix) with ESMTP id 9125240014C
	for <info@awaresystems.be>; Thu, 23 Dec 2010 13:25:53 +0100 (CET)
Received: by mx-k.b-one.net (Postfix, from userid 106)
	id 84B902810D59; Thu, 23 Dec 2010 13:25:33 +0100 (CET)
X-Virus-Scanned: by one.com
X-Spam-Flag: NO
X-Spam-Score: 0
X-Spam-Level: 
X-Spam-Status: No, score=0 tagged_above=0 required=4 tests=[none]
X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4
Received: from lists.maptools.org (lists.maptools.org [65.39.174.144]) by
 mx-k.b-one.net (Postfix) with ESMTP id 39CD22810D59 for
 <info@awaresystems.be>; Thu, 23 Dec 2010 13:25:13 +0100 (CET)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by
 lists.maptools.org (Postfix) with ESMTP id 2E9201B009B; Thu, 23 Dec 2010
 07:24:03 -0500 (EST)
Received: from smtp1-g21.free.fr (smtp1-g21.free.fr [212.27.42.1]) by
 lists.maptools.org (Postfix) with ESMTP id BB1401B009B for
 <tiff@lists.maptools.org>; Thu, 23 Dec 2010 07:23:21 -0500 (EST)
Received: from UNKNOWN (unknown [172.20.243.135]) by smtp1-g21.free.fr
 (Postfix) with ESMTP id E8B529400AA; Thu, 23 Dec 2010 13:23:15 +0100 (CET)
Received: by UNKNOWN (Postfix, from userid 0) id C0E5CEFF1FE67; Thu, 23 Dec
 2010 13:23:14 +0100 (CET)
Received: from  ([217.108.170.8]) by webmail.free.fr (IMP) with HTTP  for
 <even.rouault@172.20.243.77>; Thu, 23 Dec 2010 13:23:14 +0100
Message-ID: <1293106994.4d133f32a5b96@webmail.free.fr>
Date: Thu, 23 Dec 2010 13:23:14 +0100
From: Even Rouault <even.rouault@mines-paris.org>
To: Andrey Kiselev <dron@ak4719.spb.edu>
References: <20101222162028.GC7389@ak4719.spb.edu>
 <D6770914-4FAA-46B9-A5B2-531F57FF5839@killerbytes.com>
 <20101223105747.GA4117@ak4719.spb.edu>
In-Reply-To: <20101223105747.GA4117@ak4719.spb.edu>
MIME-Version: 1.0
User-Agent: Internet Messaging Program (IMP) 3.2.8
X-Originating-IP: 217.108.170.8
Cc: tiff@lists.maptools.org
Subject: Re: [Tiff] [ANNOUNCE]: LZMA2 codec
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.maptools.org>
List-Unsubscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
 <mailto:tiff-request@lists.maptools.org?subject=unsubscribe>
List-Archive: <http://lists.maptools.org/mailman/private/tiff>
List-Post: <mailto:tiff@lists.maptools.org>
List-Help: <mailto:tiff-request@lists.maptools.org?subject=help>
List-Subscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
 <mailto:tiff-request@lists.maptools.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org

Andrey,

I've integrated successfully the LZMA codec in GDAL GeoTIFF driver, but I have
noticed one issue. I don't manage to control the size of the resulting file by
changing the value of the TIFFTAG_LZMAPRESET tag. My analysis showed that
LZMAVSetField() only calls lzma_lzma_preset() with the passed preset value if we
are in the LSTATE_INIT_ENCODE state. But this state is only set by
LZMASetupEncode(), which as far as I can see is called at the time of the first
TIFFWriteScanline(), TIFFWriteEncodedTile() or TIFFWriteEncodedStrip(). The GDAL
driver tries to set the preset value much more early, like what is done with the
TIFFTAG_ZIPQUALITY or TIFFTAG_JPEGQUALITY that control similar parameters for
LZW and JPEG compression. So the value is ignored. Do I miss something or
shouldn't the lzma_lzma_preset(&sp->opt_lzma, sp->preset); call be moved from
LZMAVSetField() to LZMAPreEncode() ?

Best regards,

Even
_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
