Return-Path: <tiff-bounces@lists.maptools.org>
Received: from inas016.isp.belgacom.be (localhost [127.0.0.1])
        by inav022.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-AV-3.00) with ESMTP id k03HJj1F028237
        for <joris.at.lebbeke@skynet.be>; Tue, 3 Jan 2006 18:19:45 +0100
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from inmx017.isp.belgacom.be (inmx017.isp.belgacom.be [195.238.4.129])
        by inas016.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-AS-2.03) with ESMTP id k03HJdWZ028662
        for <joris.at.lebbeke@skynet.be>; Tue, 3 Jan 2006 18:19:39 +0100
        (envelope-from <tiff-bounces@lists.maptools.org>)
Received: from duke.maptools.org (r153.dmsolutions.ca [209.217.116.153] (may be forged))
        by inmx017.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-2.32) with ESMTP id k03HJXQQ001303
        for <joris.at.lebbeke@skynet.be>; Tue, 3 Jan 2006 18:19:34 +0100
        (envelope-from <tiff-bounces@lists.maptools.org>)
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 k03HCtlJ028364;
	Tue, 3 Jan 2006 12:14:00 -0500
Received: from outmx014.isp.belgacom.be (outmx014.isp.belgacom.be
	[195.238.4.69])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id k03HCpfq028361
	for <tiff@lists.maptools.org>; Tue, 3 Jan 2006 12:12:52 -0500
Received: from outmx014.isp.belgacom.be (localhost [127.0.0.1])
	by outmx014.isp.belgacom.be (8.12.11/8.12.11/Skynet-OUT-2.22) with
	ESMTP id k03HCoXB000816
	for <tiff@lists.maptools.org>; Tue, 3 Jan 2006 18:12:50 +0100
	(envelope-from <joris.at.lebbeke@skynet.be>)
Received: from dfgrrxsknr4e (104-170.246.81.adsl.skynet.be [81.246.170.104])
	by outmx014.isp.belgacom.be (8.12.11/8.12.11/Skynet-OUT-2.22) with SMTP
	id k03HCiuA000764; Tue, 3 Jan 2006 18:12:44 +0100
	(envelope-from <joris.at.lebbeke@skynet.be>)
Message-ID: <002d01c61088$e94c82a0$68aaf651@dfgrrxsknr4e>
From: "Joris" <joris.at.lebbeke@skynet.be>
To: "Rocky Pulley" <rockytriton@yahoo.com>, <tiff@lists.maptools.org>
References: <20060103130129.85249.qmail@web54309.mail.yahoo.com>
Subject: Re: [Tiff] read all uncompressed tiff data
Date: Tue, 3 Jan 2006 18:12:42 +0100
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2800.1506
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
Cc: 
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.000010b9
X-MSP-STORE: Tue, 03 Jan 2006 18:19:47 +0100
Status:   

Rocky Pulley wrote:
> I'm writing a PDF converter and I need to get  the TIFF data in
> one uncompressed chunk to put in the file.  Is it  possible to
> somehow say:
>
>   unsigned char *data;
>   int size;
>
>   TIFFGetImageData(myTiff, &data, &size);

PDF supports most compression modes that TIFF does. Thus, doing a TIFF
to PDF conversion, it is customary to not even decompress, but to snoop
the compressed image data from the TIFF and directly dump that into the
PDF. For lossy compression, like JPEG, that's not just a performance
issue, but also a size and quality issue.

For this purpose, you can use the TIFFReadRaw interface after
reading/detecting configuration from tags:

http://www.remotesensing.org/libtiff/man/TIFFReadRawStrip.3tiff.html
http://www.remotesensing.org/libtiff/man/TIFFReadRawTile.3tiff.html

> I am hoping that I don't have to do anything based on the RGB
> info or  compression level, I'm just wanting some way to get the
> image data of  the tiff.  I will need to use this metadata when
> writing info  about the image to the file, but I'm sort of hoping
> that I can just get  the image data in an easy call.

You seem to be asking for the RGBA interface.

http://www.remotesensing.org/libtiff/libtiff.html#tiffrgbaimage


But consider what I wrote above. Also, there's a tiff2pdf contribution
in the LibTiff distribution that you may find helpful.


Joris Van Damme
info@awaresystems.be
http://www.awaresystems.be/
Download your free TIFF tag viewer for windows here:
http://www.awaresystems.be/imaging/tiff/astifftagviewer.html

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