Received: from mailgate002.isp.belgacom.be (mailgate002.isp.belgacom.be [195.238.6.87])
	by maildelivery004.isp.belgacom.be (Postfix) with ESMTP id C3EC163C005
	for <joris.at.lebbeke@skynet.be>; Fri, 25 Jan 2008 06:45:34 +0100 (CET)
Authentication-Results: in.mx.skynet.be; dkim=neutral (message not signed) header.i=none
Received: from r153.dmsolutions.ca (HELO duke.maptools.org) ([209.217.116.153])
  by in.mx.skynet.be with ESMTP; 25 Jan 2008 06:45:33 +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 m0NApIbc023446;
	Wed, 23 Jan 2008 05:52:26 -0500
Received: from dns2.namehog.net (dns2.namehog.net [213.52.234.203])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id m0NAp8Va023435
	for <tiff@lists.maptools.org>; Wed, 23 Jan 2008 05:51:11 -0500
Received: from [81.86.57.99] (port=1588 helo=EKAT)
	by dns2.namehog.net with esmtpa (Exim 4.68)
	(envelope-from <andy.cave@hamillroad.com>)
	id 1JHdCX-00046k-Jf; Wed, 23 Jan 2008 10:51:26 +0000
Message-ID: <019401c85dad$d9f02ae0$c14dfea9@EKAT>
From: "Andy Cave" <andy.cave@hamillroad.com>
To: "Richard Nolde" <nrichard8@qwest.net>,
        "Tiff List" <tiff@lists.maptools.org>
References: <200801221744.m0MHiHlv000505@duke.maptools.org>
	<47966E8B.4040500@qwest.net> <003901c85d52$e74fd790$c14dfea9@EKAT>
	<47968CB6.8070204@qwest.net>
Date: Wed, 23 Jan 2008 10:51:02 -0000
Organization: Hamillroad Software
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset="iso-8859-1";
	reply-type=response
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
X-AntiAbuse: This header was added to track abuse,
	please include it with any abuse report
X-AntiAbuse: Primary Hostname - dns2.namehog.net
X-AntiAbuse: Original Domain - lists.maptools.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - hamillroad.com
X-Source: 
X-Source-Args: 
X-Source-Dir: 
Cc: 
Subject: [Tiff] Re: Tiff Digest, Vol 44, Issue 8, Cropping faxes
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.4
Precedence: list
Reply-To: Andy Cave <andy.cave@hamillroad.com>
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.00002a20
X-MSP-STORE: Fri, 25 Jan 2008 06:45:34 +0100
Status:   

Hi Richard,

Thanks for the detailed reply - is interesting to read - I didn't know that 
tiffcrop could do all that. You should call it tiffextract really, not 
tiffcrop.

BTW you can do random seeks in files with G3/G4 compressed data, but only to 
band boundaries. We do this in our FirstPROOF software. I can't remember 
without looking if this is with the scanline interface or not though.

FYI I recently added a barcode reader to FirstPROOF (we support reading & 
checking of EAN/UPC-A barcodes - at any zoom size (but clearly you need a 
'space' between the 'bars') - including calculating the BWR factor and 
size). It was really fun investigating the subject of barcodes and 
implementing a reader, never having looked at them before.

Regards,

Andy.

----- Original Message ----- 
From: "Richard Nolde" <nrichard8@qwest.net>
To: "Andy Cave" <andy.cave@hamillroad.com>; "Tiff List" 
<tiff@lists.maptools.org>
Sent: Wednesday, January 23, 2008 12:39 AM
Subject: Tiff Digest, Vol 44, Issue 8, Cropping faxes


> Andy,
> If I understand him, he wants to copy the top and bottom N rows to a new 
> image and not modify the original image. Tiffcrop has the ability to 
> extract regions or zones as I call them, from the image and write them to 
> another file. If he know the size of the images in advance, he can compute 
> X as a fraction of the page height, I use N here, and use the flags -E 
> top -Z 1:N,N:N   input.tif output.tif.  This would extract only the top 
> 1/Nth and the bottom 1/Nth of the input file, sandwiching them together 
> without the intervening N -2/Nths of the file.  For a single area, eg only 
> top or bottom, he could use -U px  -X nnn -Y nnn instead.  If he needs 
> exact numbers of pixels, modify tiffcrop to take a list of X and Y sets 
> instead of a single one.
>
> You have to read the whole image as you can't do random seeks in files 
> with G3/4 compressed data. This was Joris' point about the scanline 
> interface being less than optimal as it is broken for compressed data.
>
> I use the logic I developed for tiffcrop to do zonal extraction of bar 
> codes from selected portions of pages in a high volume document processing 
> system. Tiffcrop is my contribution to libtiff as a way to return 
> something to the community for all that it has allowed me to do with TIFF 
> images. I only support code128 bar codes at the moment but the design 
> allows for adding any other bar codes types if need be. The bar code 
> reader can be used by anyone who wants it but it is unlikely that it would 
> work with Fax images due to the low resolution and poor quality of most 
> fax machines. This may only be a limitation for code128 bar codes which 
> allow for 4 different widths of bars and are thus much more sensitive to 
> the image quality.
>
> Richard
>
> Andy Cave wrote:
>> Hi Richard,
>>
>> I don't think that tiffcrop will do what Erez wants - I think you 
>> mis-read his request. He doesn't really want to clip the 'input' image, 
>> but extract the first X rows from it and append the last X rows from it 
>> into a new image that is 2X high.
>>
>> You can do that with libtiff with a bit of programming - if all his 
>> images are 1 bit he can use the lower level APIs to extract each scanline 
>> one at a time and using a simple counter write the first X, ignore the 
>> next height-2X and write the final X to a new file.
>>
>> Regards,
>>
>> Andy.
>>
>> ----- Original Message ----- From: "Richard Nolde" <nrichard8@qwest.net>
>> To: <tiff@lists.maptools.org>
>> Sent: Tuesday, January 22, 2008 10:30 PM
>> Subject: [Tiff] Re: Tiff Digest, Vol 44, Issue 8, Cropping faxes
>>
>>
>>> 1. How to clip an image with LibTiff (Erez.Har-Tal@Walgreens.com)
>>>> Tiffcrop was written to handle just this sort of thing.  It is in the 
>>>> utilities section of recent releases and/or in CVS.  Read the man page 
>>>> or type tiffcrop --help to see all the options.
>>> Richard Nolde, tiffcrop author
>>>> ----------------------------------------------------------------------
>>>>
>>>> Message: 1
>>>> Date: Mon, 21 Jan 2008 13:38:09 -0600
>>>> From: Erez.Har-Tal@Walgreens.com
>>>> Subject: [Tiff] How to clip an image with LibTiff
>>>> To: tiff@lists.maptools.org
>>>> Message-ID:
>>>> <OFFC203445.FE96EEE5-ON862573D7.006ADF71-862573D7.006BDDBF@walgreens.com>
>>>>
>>>> Content-Type: text/plain; charset=US-ASCII
>>>>
>>>>
>>>> Hello everyone,
>>>>
>>>> Please excuse me if I am new to libtiff, so any help would be 
>>>> appreciated.
>>>>
>>>> We deal with faxes in standard mode (204X98 dpi) or fine mode (204X198 
>>>> dpi)
>>>> saved with compression of type G3 1D.
>>>>
>>>> I need to write a utility that clips the first X rows (pixel) from the 
>>>> top
>>>> of the tiff image and last X rows from the bottom of the tiff image. We
>>>> will save it to a new tiff image with G3 compression in the height of 
>>>> 2X
>>>> pixels. The first X rows will be the top of the new image and the last 
>>>> X
>>>> rows will be the bottom of the image. The operation to clip the image,
>>>> should not alter the image nor do any thing that would damage the 
>>>> image.
>>>>
>>>> Is it doable using libtiff on Unix ? Any help and direction will be 
>>>> highly
>>>> appreciated. Doable using other open source libraries ?
>>>>
>>>> Thanks,
>>>>
>>>> ====================
>>>> Erez Har-Tal
>>>> Computer Telephony
>>>> Execution Architecture and Telephony Solutions dept.
>>>>
>>> _______________________________________________
>>> Tiff mailing list: Tiff@lists.maptools.org
>>> http://lists.maptools.org/mailman/listinfo/tiff
>>> http://www.remotesensing.org/libtiff/
>>
>>
>>
>> 


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