Return-Path: <tiff-bounces@lists.maptools.org>
Delivered-To: info@awaresystems.be
Received: (qmail 3355 invoked from network); 19 Aug 2008 09:01:23 -0000
Received: from janet.telenet-ops.be ([195.130.136.6])
          (envelope-sender <tiff-bounces@lists.maptools.org>)
          by angelia.telenet-ops.be (qmail-ldap-1.03) with SMTP
          for <info@awaresystems.be>; 19 Aug 2008 09:01:23 -0000
Received: from vijay.telenet-ops.be (vijay.telenet-ops.be [195.130.136.9])
	by janet.telenet-ops.be (8.13.1/8.13.1) with ESMTP id m7J91NeB003039
	for <info@awaresystems.be>; Tue, 19 Aug 2008 11:01:23 +0200
Received: from localhost (localhost.localdomain [127.0.0.1])
	by vijay.telenet-ops.be (Postfix) with SMTP id 1716B60004
	for <info@awaresystems.be>; Tue, 19 Aug 2008 11:01:23 +0200 (CEST)
Received: from apate.telenet-ops.be (apate.telenet-ops.be [195.130.132.43])
	by vijay.telenet-ops.be (Postfix) with ESMTP id 10C9160003
	for <info@awaresystems.be>; Tue, 19 Aug 2008 11:01:23 +0200 (CEST)
Received: from duke.maptools.org (r153.dmsolutions.ca [209.217.116.153])
	by apate.telenet-ops.be (Postfix) with ESMTP id A08B727EC07
	for <info@awaresystems.be>; Tue, 19 Aug 2008 11:01:22 +0200 (CEST)
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 m7J8w0VI004320;
	Tue, 19 Aug 2008 04:59:47 -0400
Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.225])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id m7J8vuUo004314
	for <tiff@lists.maptools.org>; Tue, 19 Aug 2008 04:57:56 -0400
Received: by rv-out-0506.google.com with SMTP id f6so2437470rvb.9
	for <tiff@lists.maptools.org>; Tue, 19 Aug 2008 01:57:54 -0700 (PDT)
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:cc:in-reply-to:mime-version:content-type
	:content-transfer-encoding:content-disposition:references;
	bh=kqa/vY9IR6A0n8znpnoN2ZyD+L8iVw4FcTRgSL0BNlc=;
	b=K6R4uTLvp1aMBn+Ie4WQIy1ydlTiEMPkMMo+Ikb0PUkBHxTBauIMSIDoP0CxPA9/Gv
	QMBYdUKP+pbXj80C+hyYISUHf4Cdsov9gyf9gKtzL20kqfF4NtD/cp6j0T0kw9y68zAn
	bnqZmHvNSTj4YreR3NedWVuPGCO014e8xBCU8=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=message-id:date:from:to:subject:cc:in-reply-to:mime-version
	:content-type:content-transfer-encoding:content-disposition
	:references;
	b=IIEhJN535R1WzU36NEjxUjqEDEX4dGc/vDNszZ1ewF7JiqLwPJQ7jrGGVQhigvwcOy
	0ztv5P+nuUw7irfB4pKbM9AeW/LckVBJc/ot0EofH2Fk1zvdziZsIwMPc/XP1XJbPZyO
	3TbJorjOsjDNoguhN6Df7X3SHMqnJ9Q2rvgJ4=
Received: by 10.114.175.16 with SMTP id x16mr6306061wae.155.1219136273909;
	Tue, 19 Aug 2008 01:57:53 -0700 (PDT)
Received: by 10.114.176.7 with HTTP; Tue, 19 Aug 2008 01:57:53 -0700 (PDT)
Message-ID: <e7b7bbdc0808190157k7cd23956sc3e188d08164f61d@mail.gmail.com>
Date: Tue, 19 Aug 2008 11:57:53 +0300
From: "Bogdan Cristea" <cristeab@gmail.com>
To: "Bob Friesenhahn" <bfriesen@simple.dallas.tx.us>
Subject: Re: [Tiff] Premature EOL at line 0 of strip 4294967295 (got 0,
	expected 1728).
In-Reply-To: <Pine.SOC.4.64.0808181042150.1611@freddy.simplesystems.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
References: <200808181519.36942.bogdan.cristea@sytron.ro>
	<Pine.SOC.4.64.0808181042150.1611@freddy.simplesystems.org>
Cc: tiff@lists.maptools.org
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-SpamCatcher-Score: 10 [X]

On Mon, Aug 18, 2008 at 6:43 PM, Bob Friesenhahn
<bfriesen@simple.dallas.tx.us> wrote:
> On Mon, 18 Aug 2008, Bogdan Cristea wrote:
>
>> It is odd for me that the strip number is so big. I want to get rid of
>> this
>> warning. Any suggestions?
>
> I suggest that you tell us what version of libtiff you are using, as well as
> the operating system and CPU type.  Then maybe there is something to
> discuss.
>
> Bob
> ======================================
> Bob Friesenhahn
> bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
> GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
>
>

     I use libtiff 3.8.2 with openSuSE 10.3 on P4 32 bits.
     I have been able to remove the warning using
TIFFSetWarningHandler(NULL) before the while loop:

        TIFFErrorHandler whandler = TIFFSetWarningHandler(NULL);
	while (fakeFile->tif_rawcc > 0)
	{
		if (!((*fakeFile->tif_decoderow)(fakeFile, (tidataval_t *)rowBuf,
(tsize_t)lineSize, (tsample_t)0)))
		{
                          //bad line detected
                          badFaxLines++;
                } else
                {
                         //good line
                };

fakeFile is a TIFF file handler used only to decompress received data
and then to compute the image length, the number of bad lines, etc. I
have used as model "fax2tiff.c". Here is how fakeFile is initialized:

		fakeFile = TIFFClientOpen("(FakeInput)", "w", NULL,
				dummyReadProc, dummyWriteProc,
				dummySeekProc, dummyCloseProc, dummySizeProc,
				dummyMapProc, dummyUnmapProc);
		TIFFSetMode(fakeFile, O_RDONLY);
		setBasicTags(fakeFile);
all dummy functions return 0 except for "dummyWriteProc" which returns
"size", the last of its arguments.

However, I would like to know if there is a better way to remove this
warning, because it seems that some internal variable of the tiff
library is not initialized.

Further, when computing the number of bad lines, "badFaxLines",
actually it's the number of detections of bad lines, since a bad line
could contain several lines of the actual fax image. Is this correct?
Is there a better way to detect the number of bad lines?

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