Return-Path: <tiff-bounces@lists.maptools.org>
X-Original-To: info@awaresystems.be
Delivered-To: info@awaresystems.be
Received: from mx-q.b-one.net (mx-q.one.com [91.198.169.248])
	by mail9.b-one.net (Postfix) with ESMTP id C2AF5400107
	for <info@awaresystems.be>; Fri, 25 Jun 2010 03:02:14 +0200 (CEST)
Received: by mx-q.b-one.net (Postfix, from userid 106)
	id A646371BFA61; Fri, 25 Jun 2010 03:02:05 +0200 (CEST)
X-Virus-Scanned: by one.com
X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4
Received: from lists.maptools.org (lists.maptools.org [65.39.174.144]) by
 mx-q.b-one.net (Postfix) with ESMTP id 71CE471BFA61 for
 <info@awaresystems.be>; Fri, 25 Jun 2010 03:02:04 +0200 (CEST)
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by
 lists.maptools.org (Postfix) with ESMTP id 0C0961D184BD0; Thu, 24 Jun 2010
 20:00:51 -0500 (EST)
Received: from mail.howardsilvan.com (216-235-106-HCC-115.hcc.net
 [216.235.106.115]) by lists.maptools.org (Postfix) with ESMTPS id
 029A71D184BD0 for <tiff@lists.maptools.org>; Thu, 24 Jun 2010 19:44:27 -0500
 (EST)
Received: from fangorn.howardsilvan.com (localhost [127.0.0.1]) by
 mail.howardsilvan.com (Postfix) with ESMTP id 0DD5EC42096; Thu, 24 Jun 2010
 17:44:16 -0700 (PDT)
Received: from bilbo.x101.com ([64.146.212.27] helo=bilbo.x101.com) with
 IPv4:25 by fangorn.howardsilvan.com; 24 Jun 2010 17:44:15 -0700
Message-ID: <4C23FBE4.5090006@howardsilvan.com>
Date: Thu, 24 Jun 2010 17:44:20 -0700
From: Lee Howard <faxguy@howardsilvan.com>
User-Agent: Thunderbird 2.0.0.19 (X11/20090105)
MIME-Version: 1.0
To: Bratislav Stojanovic <bratislav@investintech.com>
References: <ED6DD2DBFFF146368BC39EECC943F05F@WINJAL8H4LNY3T>
In-Reply-To: <ED6DD2DBFFF146368BC39EECC943F05F@WINJAL8H4LNY3T>
Cc: tiff@lists.maptools.org
Subject: Re: [Tiff] Problematic fax image
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

Bratislav Stojanovic wrote:
> I'm trying to decompress one CCITT G3 1-D image using libTIFF, and I 
> simply don't know what might be the problem.
>  
> The explanation: I have a CCITT G3 1-D image inside a memory buffer. 
> I'm using TIFFClientOpen & ReadEncodedStrip. It all
> works fine with one of the G3 images taken from the pics package, as 
> well with some other G3 images I've tried. But for this
> one, it just won't work.
>  
> The library will report the following:
>  
> c:\Users\Bratislav\Documents\Visual Studio 
> 2005\Projects\ccitt\Debug>ccitt.exe
>  
> BitAcc=00000000, BitsAvail = 0
> -------------------- 0
> Fax3Decode1D: Warning, dummy: Line length mismatch at line 0 of strip 
> 0 (got 537
> , expected 536).
>  
> BitAcc=0000053F, BitsAvail = 11
> -------------------- 0
> Fax3Decode1D: Warning, dummy: Premature EOL at line 1 of strip 0 (got 
> 0, expecte
> d 536).
>  
> BitAcc=00000000, BitsAvail = 1
> -------------------- 0
> Fax3Decode1D: Warning, dummy: Premature EOL at line 2 of strip 0 (got 
> 20, expect
> ed 536).
>  
> BitAcc=00000020, BitsAvail = 6
> -------------------- 0
> Fax3Decode1D: Warning, dummy: Premature EOL at line 3 of strip 0 (got 
> 20, expect
> ed 536).
>  
> BitAcc=00000020, BitsAvail = 6
> -------------------- 0
> Fax3Decode1D: Warning, dummy: Premature EOL at line 4 of strip 0 (got 
> 4, expecte
> d 536).
>  
> BitAcc=00000000, BitsAvail = 2
> -------------------- 0
> Fax3Decode1D: Warning, dummy: Premature EOL at line 5 of strip 0 (got 
> 0, expecte
> d 536).
>  
> Those are all warnings, but then the ReadEncodedStrip will return a 
> number < 0, which means
> something is wrong, and the code will fail. BTW, the output is written 
> into a PBM file (basically
> a small header + samples).
>  
> In the attachment you will find :
> - simple console-based application used for decompression
> - problematic image inside a separate file (this file will be loaded 
> into a image buffer). Image is CCITT G3 codestream
> only (no headers, trailers etc.). The size of the image is 536 (width) 
> x 133 (height).
>  
> I'm using the latest stable version, 3.9.4 downloaded a few days ago.

The warning messages indicate that the data is corrupt.  The number of 
pixels decoded in each line do not match up with the expected width of 536.

Be wary, too, that a fax is usually 1728 pixels wide.

I'm not sure that I have anything else to go on here unless I were to 
look at the G3 image stream you provided and start trying to figure out 
the exact details of its corruption.  I'd suggest going back to whatever 
produced this G3 image stream and check for malfunctions.

Thanks,

Lee.

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