Return-Path: <tiff-bounces@remotesensing.org>
Received: from inmx008.isp.belgacom.be (inmx008.isp.belgacom.be [195.238.3.88])
        by mailst006.isp.belgacom.be (8.12.11/8.12.11/Skynet-MAILSTORE-2.14) with ESMTP id i6QDPfqP022421
        for <joris.at.lebbeke@skynet.be>; Mon, 26 Jul 2004 15:25:41 +0200
        (envelope-from <tiff-bounces@remotesensing.org>)
Received: from xserve.flids.com (adsl-065-083-169-202.sip.mco.bellsouth.net [65.83.169.202])
        by inmx008.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-2.32) with ESMTP id i6QDPaNv019811
        for <joris.at.lebbeke@skynet.be>; Mon, 26 Jul 2004 15:25:37 +0200
        (envelope-from <tiff-bounces@remotesensing.org>)
Received: from adsl-065-083-169-202.sip.mco.bellsouth.net (localhost [127.0.0.1])
	by xserve.flids.com (Postfix) with ESMTP
	id E90C4167CF1; Mon, 26 Jul 2004 09:25:17 -0400 (EDT)
X-Original-To: tiff@remotesensing.org
Delivered-To: tiff@remotesensing.org
Received: from outmx015.isp.belgacom.be (outmx015.isp.belgacom.be
	[195.238.2.87])
	by xserve.flids.com (Postfix) with ESMTP id CA514167CCE
	for <tiff@remotesensing.org>; Mon, 26 Jul 2004 09:25:14 -0400 (EDT)
Received: from outmx015.isp.belgacom.be (localhost [127.0.0.1])
	by outmx015.isp.belgacom.be (8.12.11/8.12.11/Skynet-OUT-2.22) with
	ESMTP id i6QDP6k5017251
	for <tiff@remotesensing.org>; Mon, 26 Jul 2004 15:25:06 +0200
	(envelope-from <joris.at.lebbeke@skynet.be>)
Received: from dfgrrxsknr4e (145-15.241.81.adsl.skynet.be [81.241.15.145])
	by outmx015.isp.belgacom.be (8.12.11/8.12.11/Skynet-OUT-2.22) with SMTP
	id i6QDP4sl017237
	for <tiff@remotesensing.org>; Mon, 26 Jul 2004 15:25:04 +0200
	(envelope-from <joris.at.lebbeke@skynet.be>)
Message-ID: <001101c47313$fb270db0$910ff151@dfgrrxsknr4e>
From: "Joris" <joris.at.lebbeke@skynet.be>
To: <tiff@remotesensing.org>
References: <b35303704072603075187a08@mail.gmail.com>
Subject: Re: [Tiff] Is this possible by using LibTiff?
Date: Mon, 26 Jul 2004 15:25:11 +0200
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.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
X-BeenThere: tiff@remotesensing.org
X-Mailman-Version: 2.1.2
Precedence: list
List-Id: TIFF and libtiff discussion  <tiff.remotesensing.org>
List-Unsubscribe: <http://xserve.flids.com/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=unsubscribe>
List-Archive: <http://xserve.flids.com/pipermail/tiff>
List-Post: <mailto:tiff@remotesensing.org>
List-Help: <mailto:tiff-request@remotesensing.org?subject=help>
List-Subscribe: <http://xserve.flids.com/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=subscribe>
Sender: tiff-bounces@remotesensing.org
Errors-To: tiff-bounces@remotesensing.org
X-UIDL: 71144a5a0088dc336f57afcc7d21c03b

> # 1. Is it possible to just store the Tiff Directory with all tags
> except-the-image-pixel-data, so that I can later easily
> recreate a Tiff with same characteristics as the original file?

I don't think exactly this functionality is included in LibTiff. I wouldn't
advice this exact way of doing it, anyhow. Either
1) the tags-except-image-pixel data stuff is fixed. In that case, hard-code it
2) the tags-except-image-pixel data stuff is flexible. Perhaps there's a UI
somewhere or another application somewhere that builds these 'tagsets', and the
same code has to be able to mix the flexible tagset and the image data. In that
case, I advise designing a proprietary data file format for these tagsets. Could
be based on TIFF, could even be based on LibTiff, but make sure you don't copy
the TIFF header in this proprietary tagset data file format, or you're bound to
cause trouble in the end. For instance, the proprietary format could be as
simple as a single TIFF IFD with auxiliary tag data, not including a TIFF file
header, or the 'next IFD' pointer. Consult the TIFF spec on this, it's quite
simple.

> # 2. Assuming that I have the above directory of tags, and a buffer
> with all the image data... how can i recreate the tiff?

Consult your LibTiff documentation, and the LibTiff utilities code. It's all
there.

> I saw that we have a function ' TIFFRGBAImage ' to read the image data...
>
> But we dont have a corrsponding "write" function. Also, the above
> function can cause loss of information/quality if bits per sample is
> more than 8.

...and it causes major criminally waste of space for singlebit pixel data, and
it has trouble converting from/to stuff like CMYK, and it has no special
provision for dealing with huge images which require special techniques, etc.
It's really not meant to be a good interface, all by itself. Instead, use the
RGBA series as either a) a hack at most common TIFFs, or b) excellent
documentation on how to build your own interface to LibTiff, to your own needs.
If you're into doing things properly, that's exactly what the strip and tile
series are for. Again, consult LibTiff documentation,

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

and/or

http://www-106.ibm.com/developerworks/linux/library/l-libtiff/
http://www-106.ibm.com/developerworks/linux/library/l-libtiff2/


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@remotesensing.org
http://xserve.flids.com/mailman/listinfo/tiff
