Received: from mailgate002.isp.belgacom.be (mailgate002.isp.belgacom.be [195.238.6.87])
	by maildelivery021.isp.belgacom.be (Postfix) with ESMTP id BF5643C41F1
	for <joris.at.lebbeke@skynet.be>; Fri, 15 Feb 2008 15:56:27 +0100 (CET)
Authentication-Results: in.mx.skynet.be; dkim=permerror (body hash did not verify [final] [TEST]) header.i=@gmail.com
Received: from r153.dmsolutions.ca (HELO duke.maptools.org) ([209.217.116.153])
  by in.mx.skynet.be with ESMTP; 15 Feb 2008 15:56:26 +0100
Received: from duke.maptools.org (duke.maptools.org [127.0.0.1])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id m1FEa9T5031246;
	Fri, 15 Feb 2008 09:37:08 -0500
Received: from el-out-1112.google.com (el-out-1112.google.com [209.85.162.182])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id m1FEa73H031232
	for <tiff@lists.maptools.org>; Fri, 15 Feb 2008 09:36:07 -0500
Received: by el-out-1112.google.com with SMTP id v27so603813ele.23
	for <tiff@lists.maptools.org>; Fri, 15 Feb 2008 06:36:06 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition;
	bh=tFeZQUZeMhIi3ywsBOUnnFu5Qsxq5yVonI1z0CfVQv8=;
	b=OJ/cCzwQvnawVBTW7Vjm7FEk3maGLveupiMAe/2wRjt0Q2QAWtou7KF0QfvxP4ASKZXyZnFTL2h6phqd/OZ4m0PA57+XCqH/ajrK4HCG9xdi/FLumc5ARIAqYvcjk0Mx/UK0zvk50+BcqCCs3vL8uRbFXhl/zodNKnOECGTHBNI=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition;
	b=fmkwQX+9r8FPnKE8fzN1TxMS9/nZTlnQq4bAEQC1+rL/4e2QZplt5EACS0CU+o/1UdHiGrEn6fRS6ximD0xujSee0YKvvpsTRT813ovMcySk4Eznx4DjHkSjxYSzhsXUIHPvgY2PLwV+gDQBf4eUHhZigXGDBoInC8Guqltg3sY=
Received: by 10.142.212.19 with SMTP id k19mr2307497wfg.154.1203086165653;
	Fri, 15 Feb 2008 06:36:05 -0800 (PST)
Received: by 10.142.147.2 with HTTP; Fri, 15 Feb 2008 06:36:05 -0800 (PST)
Message-ID: <522c6460802150636t65f055a0v7e2665b393aee66e@mail.gmail.com>
Date: Fri, 15 Feb 2008 14:36:05 +0000
From: jcupitt@gmail.com
To: "libtiff - Liste" <tiff@lists.maptools.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Subject: [Tiff] bug? JPEGQUALITY seems not to be read correctly
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.4
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>
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org
X-UIDL: 000000000023ceae.00002ab0
X-MSP-STORE: Fri, 15 Feb 2008 15:56:27 +0100
Status:   

I think I might have found a bug (or misfeature) in JPEG quality handling.

If I write a file with TIFFTAG_JPEGQUALITY set to 100, it seems to work:

john@mm-jcupitt2:~/pics$ im_copy healthygirl.jpg test.tif:jpeg:100
john@mm-jcupitt2:~/pics$ im_copy healthygirl.jpg test2.tif:jpeg:75
john@mm-jcupitt2:~/pics$ ls -l test*
-rw-r--r-- 1 john john  643587 2008-02-15 14:29 test2.tif
-rw-r--r-- 1 john john 2267003 2008-02-15 14:29 test.tif

So we get a much larger file, as expected. But if I look at the files
with tiffinfo, the TIFFTAG_JPEGQUALITY tag is not displayed:

john@mm-jcupitt2:~/pics$ tiffinfo test.tif
TIFF Directory at offset 0x2291ae (2265518)
  Image Width: 1166 Image Length: 1944
  Resolution: 118.11, 118.11 pixels/cm
  Bits/Sample: 8
  Compression Scheme: JPEG
  Photometric Interpretation: RGB color
  YCbCr Subsampling: 2, 2
  Orientation: row 0 top, col 0 lhs
  Samples/Pixel: 3
  Rows/Strip: 16
  Planar Configuration: single image plane
  JPEG Tables: (289 bytes)

and if I copy the file, quality seems to revert to the default (75):

john@mm-jcupitt2:~/pics$ tiffcp test.tif test3.tif
john@mm-jcupitt2:~/pics$ ls -l test*.tif
-rw-r--r-- 1 john john  643587 2008-02-15 14:29 test2.tif
-rw-r--r-- 1 john john  244444 2008-02-15 14:30 test3.tif
-rw-r--r-- 1 john john 2267003 2008-02-15 14:29 test.tif

So it seems that TIFFTAG_JPEGQUALITY is either not being written, or
that on reading it is always set to the default 75. This is with
libtiff 3.8.2.

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