Received: from sgi.sgi.com (192.48.153.1) by cerious.com
 with SMTP (Apple Internet Mail Server 1.1.1); Thu, 14 Nov 1996 19:03:28 -0500
Received: from cthulhu.engr.sgi.com (cthulhu.engr.sgi.com [192.26.80.2]) by sgi.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA00127; Thu, 14 Nov 1996 15:51:27 -0800
Received: (from daemon@localhost) by cthulhu.engr.sgi.com (950413.SGI.8.6.12/960327.SGI.AUTOCF) id VAA22386 for tiff-list; Thu, 14 Nov 1996 21:08:35 GMT
Received: from sgi.sgi.com (sgi.engr.sgi.com [192.26.80.37]) by cthulhu.engr.sgi.com (950413.SGI.8.6.12/960327.SGI.AUTOCF) via ESMTP id NAA22380 for <tiff-relay@relay.engr.sgi.com>; Thu, 14 Nov 1996 13:08:34 -0800
Received: from universal.ca (caris.universal.ca [198.164.13.1]) by sgi.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via SMTP id NAA21801 for <tiff@sgi.com>; Thu, 14 Nov 1996 13:08:32 -0800
Received: by universal.ca (4.1/SMI-4.1)
	id AA22374; Thu, 14 Nov 96 17:06:07 AST
Date: Thu, 14 Nov 1996 17:06:06 -0400 (AST)
From: Magdy Halim <halim@caris.universal.ca>
To: frankkim@server.net
Cc: tiff@sgi.com
Subject: Re: Single TIFF read/write
In-Reply-To: <199611141905.OAA30039@bluejay.server.net>
Message-Id: <Pine.SUN.3.91.961114170214.22102A-100000@caris>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: owner-tiff@relay.engr.SGI.COM
Precedence: bulk


I managed to do it without compression, it works great as long as you
don't mess up the image attributes (width, height, ...etc)

But it doesn't like compression since it alters the strip offsets due to
the different data inserted.

I gave up on the compression for now.

Thanks for your response

Magdy

   :---------------------------------:------------------------------:
   | Magdy Halim                     | Universal Systems Ltd.       |
   | Project Manager                 | 264 Rookwood Avenue,         |
   | Email: halim@universal.ca       | Fredericton, New Brunswick   |
   | Tel: (506) 458-8533             | E3B 2M2, CANADA              |
   | Fax: (506) 459-3849             |                              |
   |---------------------------------+------------------------------|
   | Sales: sales@universal.ca       | URL: http://www.universal.ca |
   |---------------------------------+------------------------------|


On Thu, 14 Nov 1996, Frank Kim wrote:

> Magdy Halim writes:
>  > 
>  > Hi Sam,
>  > 
>  > I was wondering if you know of a way to read and write to the same tiff
>  > file. I tried the "r+" mode but i had to close and open the file every
>  > time i change a scanline, besides it doesn't like compression (even when
>  > the rowsperstrip field is 1).
>  > 
>  > The reason being that i have a 1.6 Gbyte image and opening a new one is
>  > practically impossible.
>  > 
>  > All i wanna do is change some pixels inside the image.
>  > 
>  > Appreciate a quick reponse
>  > 
>  > Magdy
> 
> 
> According to the HTML documentation (tiff-v3.4/html/libtiff.html#FIO):
> 
>       Note that unlike the stdio library TIFF image files may not be
> opened for both reading and writing; there is no support for altering
> the contents of a TIFF file.
> 
> 
> I tried doing both a read and write in some programs.  Sometimes it
> worked but other times I got seg faults.  I'd have to say it sounds like
> a bad idea.
> 
> Frank Kim	NetCentric Corporation
> 		17 Monsignor O'Brien Highway, Cambridge, MA, 02141
> 		frankkim@server.net     (617)720-5200 x143
> 		http://cag-www.lcs.mit.edu/~frankkim/
>                    
> 
