Return-Path: <tiff-bounces@remotesensing.org>
Received: from inmx016.isp.belgacom.be (inmx016.isp.belgacom.be [195.238.2.219])
        by mailst035.isp.belgacom.be (8.12.11/8.12.11/Skynet-MAILSTORE-2.14) with ESMTP id j1PD7Crl006447
        for <joris.at.lebbeke@skynet.be>; Fri, 25 Feb 2005 14:07:13 +0100
        (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 inmx016.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-2.32) with ESMTP id j1PD71aY014500
        for <joris.at.lebbeke@skynet.be>; Fri, 25 Feb 2005 14:07:02 +0100
        (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 3931ED70409; Fri, 25 Feb 2005 08:06:42 -0500 (EST)
X-Original-To: tiff@remotesensing.org
Delivered-To: tiff@remotesensing.org
Received: from outmx011.isp.belgacom.be (outmx011.isp.belgacom.be
	[195.238.3.3])
	by xserve.flids.com (Postfix) with ESMTP id 7BF9AD703E5
	for <tiff@remotesensing.org>; Fri, 25 Feb 2005 08:06:40 -0500 (EST)
Received: from outmx011.isp.belgacom.be (localhost [127.0.0.1])
	by outmx011.isp.belgacom.be (8.12.11/8.12.11/Skynet-OUT-2.22) with
	ESMTP id j1PD6cE2028398
	for <tiff@remotesensing.org>; Fri, 25 Feb 2005 14:06:38 +0100
	(envelope-from <joris.at.lebbeke@skynet.be>)
Received: from dfgrrxsknr4e (91-170.245.81.adsl.skynet.be [81.245.170.91])
	by outmx011.isp.belgacom.be (8.12.11/8.12.11/Skynet-OUT-2.22) with SMTP
	id j1PD6Yxx028379; Fri, 25 Feb 2005 14:06:34 +0100
	(envelope-from <joris.at.lebbeke@skynet.be>)
Message-ID: <000901c51b3a$e1d939d0$5baaf551@dfgrrxsknr4e>
From: "Joris" <joris.at.lebbeke@skynet.be>
To: "Priyanshu Sharma" <priyanshu.sharma@gmail.com>
References: <78bc1718050225002134704e5a@mail.gmail.com><003e01c51b27$eb4d3fb0$a1b9f551@dfgrrxsknr4e>
	<78bc1718050225035741368886@mail.gmail.com>
Subject: Re: [Tiff] How to get a thumbnail View for a single page TIFF file.
Date: Fri, 25 Feb 2005 14:06:47 +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.1478
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1478
Cc: tiff@remotesensing.org
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: 2580caf6ebf328b3d605a790c80e4507

Priyanshu,

> PROBLEM:
> I have a 1 page tiff file and i want to get its thumbnailview as
> another tiff file.

Do you want to write a new TIFF file, with some image (that is a thumbnail
version of another TIFF file, but it should not matter)?
- If not, I still don't understand your intentions.
- If so, this is normal TIFF writing... Don't let the fact that your destination
single-page TIFF file's image is the thumbnail of another input TIFF confuse
you, it doesn't matter where your input comes from.

For normal writing of a new singlepage TIFF file:

- First use TIFFOpen with the 'w' flag
- Next use TIFFSetField to set all basic tags, like
    - ImageWidth, ImageLength
    - BitsPerSample, SamplesPerPixel
    - possibly XResolution, YResolution, ResolutionUnit
    - Photometric, Compression
- Another set of tags you need to set now, depends on whether you intend to
write a stripped or tiled TIFF. Since you seem to want to write a thumbnail
sized image, I guess stripped TIFF is the way to go. In this case, set the
RowsPerStrip tag. If the thumbnail is small enough, set it to the complete
ImageLength
- Next you need to write the actual pixel data. How to do this, again depends on
whether you intend to write a stripped or tile TIFF. For a stripped TIFF, the
most convinient function to use is probably TIFFWriteScanline.
- Finally use TIFFClose.

Is this what you're after? Andrey at one time posted loads of useful code
snippets for related tasks to the mailing list, be sure to also browse the
archive at http://www.awaresystems.be/imaging/tiff/tml.html. I can't do the
same, I'm a Delphi coder and no longer used to writing C.


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
