From: vaino.jarvela@pp.inet.fi (=?iso-8859-15?B?VuRpbvYgSuRydmVs5A==?=)
Date: Tue, 2 Sep 2003 08:43:42 +0300
Subject: [Tiff] Reading and writing to memory.
In-Reply-To: <026301c370bd$a16163b0$320d1282@ercwin.erc.msstate.edu>
References: <20030901114922.GA4270@vital> <026301c370bd$a16163b0$320d1282@ercwin.erc.msstate.edu>
Message-ID: <20030902054342.GA6277@vital>

On Mon, Sep 01, 2003 at 14:17:04 -0500, Pushkar Pradhan wrote:
> Can't you just read in one tile or strip at a time, manipulate it and write
> it out to the new file.
> The TIFFReadTile, TIFFReadRawTile (uncompressed data is returned) should do
> it?

Actually this is how i'm doing it right now. But writing it to memory
would be faster as i'm going to run the image through multiple functions
that use the whole image.

> Pushkar Pradhan
> ----- Original Message -----
> From: "Väinö Järvelä" <vaino.jarvela@pp.inet.fi>
> To: <tiff@remotesensing.org>
> Sent: Monday, September 01, 2003 6:49 AM
> Subject: [Tiff] Reading and writing to memory.
> 
> 
> > Hello,
> >
> >
> > My software has to manipulate some very large TIFF images. The images
> > are so big that they won't fit in the memory uncompressed, so i need to
> > have the images compressed in the memory and uncompress it strip at a
> > time , manipulate and compress back to the memory. When the
> > manipulations are complete, then write it to a file.
> >
> > I know i could pump up the swap space, but it might be faster to do it
> > all in memory even with all this uncompressing and compressing than
> > writing and reading gigabytes of data from and to swap(done
> > automatically by kernel ofcourse) and work from there.
> >
> > I have tried using TIFFClientOpen by creating my own
> > read,write,seek,size procs which pass a struct (through thandle_t) to
> > the functions and manipulate the data(image buffer) in the struct. But
> > when i try to "open" the memory with
> >
> > Tiff = TIFFClientOpen( "dummy", "w", (thandle_t) &mt, tiffMemReadProc,
> > tiffMemWriteProc, tiffMemSeekProc, tiffMemCloseProc, tiffMemSizeProc,
> > NULL, NULL );
> >
> > It fails by saying: "dummy: Not a TIFF file, bad magic number 0 (0x0)."
> >
> > I don't undestand this error message.. i'm not trying to read or append
> > (to) an old TIFF file, but it apparently still tries to read one?
> >
> >
> > Is there anything specific i have to do in those procs? Return a
> > specific value on the first run or something?
> >
> > Is mmap and unmap procs mandatory?
> >
> >
> > Regards,
> > --
> > Väinö Järvelä
> > _______________________________________________
> > Tiff mailing list
> > Tiff@remotesensing.org
> > http://remotesensing.org/mailman/listinfo/tiff
> >
> 
> _______________________________________________
> Tiff mailing list
> Tiff@remotesensing.org
> http://remotesensing.org/mailman/listinfo/tiff

-- 
Väinö Järvelä

