Return-Path: owner-tiff@olympiakos.com
Return-Path: <owner-tiff@olympiakos.com>
Received: from localhost (localhost [127.0.0.1])
	by at1895.spb.edu (8.12.0.Beta7/8.12.0.Beta7) with ESMTP id f6K8c1G3022970
	for <dron@localhost>; Fri, 20 Jul 2001 13:00:00 +0400
Received: from eudoramail.com [209.185.123.45]
	by localhost with POP3 (fetchmail-5.8.1)
	for dron@localhost (single-drop); Fri, 20 Jul 2001 13:00:00 +0400 (MSD)
Received: from gate7.olympiakos.com ([207.176.88.85]) by shared1-mail.whowhere.com; Thu Jul 19 18:27:49 2001
Received: from localhost (daemon@localhost)
	by gate7.olympiakos.com (8.9.3/8.9.3) with SMTP id UAA13235;
	Thu, 19 Jul 2001 20:38:17 -0400
Received: by gate7.olympiakos.com (bulk_mailer v1.9); Thu, 19 Jul 2001 20:36:09 -0400
Received: (from majordom@localhost)
	by gate7.olympiakos.com (8.9.3/8.9.3) id UAA13174
	for tiff-outgoing; Thu, 19 Jul 2001 20:36:08 -0400
X-Authentication-Warning: gate7.olympiakos.com: majordom set sender to owner-tiff@olympiakos.com using -f
Received: from mail.mediacy.com (mail.mediacy.com [209.183.194.67])
	by gate7.olympiakos.com (8.9.3/8.9.3) with ESMTP id UAA13168
	for <tiff@olympiakos.com>; Thu, 19 Jul 2001 20:35:53 -0400
Received: by mail.mediacy.com from localhost
    (router,SLMail V5.0); Thu, 19 Jul 2001 17:30:29 -0400 
    for <tiff@olympiakos.com>
Received: from sean [209.183.197.241]
 by mail.mediacy.com [209.183.194.67]  (SLmail 5.0.0.4342) with SMTP
 id E6BBAC457C4811D5BFE800104B2D6CEC
 for <tiff@olympiakos.com>; Thu, 19 Jul 2001 17:30:28 -0400
From: "Sean Finn" <sean@mediacy.com>
To: <tiff@olympiakos.com>
Subject: LZW TIFFReadScanline woes
Date: Thu, 19 Jul 2001 17:29:05 -0400
Message-ID: <001601c11099$d661d120$720a0a0a@mediacy.com>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook 8.5, Build 4.71.2377.0
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2462.0000
X-SLUIDL: E0E84802-7C4811D5-BFE80010-4B2D6CEC
Sender: owner-tiff@olympiakos.com
Status: RO
Content-Length: 1167
Lines: 30

I'm using libTIFF to read/sub-sample a TIFF file.

So, basically, I figure out which lines I want to read, read in the entire
line via TIFFReadScanline, and then chop out the sub-sampled pixels I want
from that line, then go to the next line.

Everything works fine until I try to read an LZW compressed file.  My
company has its own LZW license from Unisys, so no worries there.  But, I am
using the libTIFF LZW package.

When reading the LZW compressed file, the sub-sampling is all wrong, giving
me a very chunky and distorted looking image.  So, the question is, with
LZW, does TIFFReadScanline read in a compressed line's worth of pixels or an
uncompressed?  In case that wasn't clear, here's a scenario:

Compressed width = 50
Uncompressed width = 100

TIFFReadScanline(m_tif, buf, 1);

Does this uncompress the LZW data (50 bytes), then place the new 100 bytes
worth of pixels in my buffer?  Or, does it read 100 bytes of LZW data,
uncompress it, and put all it can into my buffer (giving me 200 pixels
worth)?  Since all other compression modules work with my code, I am
assuming the problem lies in the LZW code.

Thanks for any help,

Sean
sean@mediacy.com

