Return-Path: <owner-tiff@olympiakos.com>
Received: from nataly.at1895.spb.edu (localhost [127.0.0.1])
	by at1895.spb.edu (8.12.4/8.12.4/Debian-4) with ESMTP id g9BBjWYR017227
	for <dron@at1895.spb.edu>; Fri, 11 Oct 2002 15:45:32 +0400
Received: from olympiakos.com (uucp@localhost)
	by nataly.at1895.spb.edu (8.12.4/8.12.4/Debian-4) with UUCP id g9BBjWxq017224
	for dron@at1895.spb.edu; Fri, 11 Oct 2002 15:45:32 +0400
Received: from knot.pu.ru (knot.pu.ru [193.124.85.214] (may be forged))
	by wg.pu.ru (8.9.1a/8.9.1) with ESMTP id LAA06733
	for <dron@at1895.spb.edu>; Fri, 11 Oct 2002 11:33:42 GMT
Received: from gate7.olympiakos.com (sdsl-64-32-199-150.dsl.iad.megapath.net [64.32.199.150])
	by knot.pu.ru (8.9.3/8.9.0) with ESMTP id PAA16019
	for <dron@at1895.spb.edu>; Fri, 11 Oct 2002 15:33:41 +0400 (MSD)
Received: from localhost (daemon@localhost)
	by gate7.olympiakos.com (8.9.3/8.9.3) with SMTP id DAA26004;
	Fri, 11 Oct 2002 03:54:51 -0400
Received: by gate7.olympiakos.com (bulk_mailer v1.9); Fri, 11 Oct 2002 03:41:56 -0400
Received: (from majordom@localhost)
	by gate7.olympiakos.com (8.9.3/8.9.3) id DAA25892
	for tiff-outgoing; Fri, 11 Oct 2002 03:41:56 -0400
X-Authentication-Warning: gate7.olympiakos.com: majordom set sender to owner-tiff@olympiakos.com using -f
Received: from phobos.euromap.de (phobos.euromap.de [195.98.193.4])
	by gate7.olympiakos.com (8.9.3/8.9.3) with SMTP id DAA25889
	for <tiff@olympiakos.com>; Fri, 11 Oct 2002 03:41:53 -0400
Received: (qmail 24302 invoked by uid 1104); 11 Oct 2002 08:16:13 -0000
Received: from barner@euromap.de by phobos with qmail-scanner-1.00 (. Clean. Processed in 1.198783 secs); 11 Oct 2002 08:16:13 -0000
X-Qmail-Scanner-Mail-From: barner@euromap.de via phobos
X-Qmail-Scanner-Rcpt-To: tiff@olympiakos.com
X-Qmail-Scanner: 1.00 (Clean. Processed in 1.198783 secs)
Received: from ulysses.euromap.de (195.98.193.196)
  by phobos.euromap.de with SMTP; 11 Oct 2002 08:16:10 -0000
Received: (from barner@localhost)
	by ulysses.euromap.de (8.11.5/8.11.5) id g9B7dkw15611
	for tiff@olympiakos.com; Fri, 11 Oct 2002 09:39:46 +0200 (MDT)
Date: Fri, 11 Oct 2002 09:39:46 +0200 (MDT)
From: Frithjof Barner <barner@euromap.de>
Message-Id: <200210110739.g9B7dkw15611@ulysses.euromap.de>
To: tiff@olympiakos.com
Subject: 2 GB limit ?
Sender: owner-tiff@olympiakos.com
Precedence: bulk
Status: RO
X-Status: A
Content-Length: 2487
Lines: 85


Hi,

Is there a 2GB limit in tiff-v3.5.7 version 20011128?
My linux ext2 file system supports larger files but I am not
able to write an RGB TIFF greater than 2 GB.

cassini:> ./a.out
TIFF test, version 20011128
TIFFAppendToStrip: test_tiff.tif: Write error at scanline 682.
Can't write raw strip
cassini:> dd if=/dev/zero of=test_tiff.bin bs=1048576 count=3000
3000+0 records in
3000+0 records out
cassini:> ls -la test*
-rw-r--r--    1 barner   users    3145728000 Oct  9 16:40 test_tiff.bin
-rw-r--r--    1 barner   users    2147483647 Oct  9 16:32 test_tiff.tif

The code for a.out is below. Is there a limit or do I make something wrong?
Are there any work arounds?

Thanks
Frithjof


#include <stdio.h>
#include <tiffio.h>


#define NCOLS (uint32)1024 * (uint32)1024       /* 1MB*/ 
#define NROWS (uint32)683             /*  682 works, 683 does not work*/

/*2GB > (1024*1024 cols * 3bands * 682 rows )*/
/*2GB < (1024*1024 cols * 3bands * 683 rows )*/

int main()
{
   TIFF* tif; 
 
   unsigned char line_r[NCOLS];
   unsigned char line_g[NCOLS];
   unsigned char line_b[NCOLS];
   uint32  r;

   fprintf(stdout, "TIFF test, version %d\n",TIFFLIB_VERSION);

   tif=TIFFOpen("test_tiff.tif", "w");
   if (!tif)
   {
       TIFFError("test_tiff.tif","Can not open output image");
       exit(-1);
   }

   TIFFSetField(tif, TIFFTAG_IMAGEWIDTH,  (uint32) NCOLS);
   TIFFSetField(tif, TIFFTAG_IMAGELENGTH, (uint32) NROWS);

   TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, 3);
   TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE,   8);
   TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP,    1);

   TIFFSetField(tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_SEPARATE);
   TIFFSetField(tif, TIFFTAG_PHOTOMETRIC,  PHOTOMETRIC_RGB      );
   TIFFSetField(tif, TIFFTAG_COMPRESSION,  COMPRESSION_NONE     );

   for (r=0; r<NROWS; r++)
   {
         if ((TIFFWriteRawStrip(tif, r,             line_r, NCOLS)<0) ||
             (TIFFWriteRawStrip(tif, NROWS+r,       line_g, NCOLS)<0) ||
             (TIFFWriteRawStrip(tif, NROWS+NROWS+r, line_b, NCOLS)<0) )
         {
            fprintf(stderr, "Can't write raw strip\n");
            exit(-1);
         }
   }

   TIFFClose(tif);
   return(0);
}

euromap GmbH, Kalkhorstweg 53, D-17235 Neustrelitz, Germany
Tel: +49 (0)3981/4883-13, Fax: +49 (0)3981/4883-20
mailto:barner@euromap.de, http://www.euromap.de

To subscribe or unsubscribe email tiff-request@olympiakos.com with subscribe
or unsubscribe in the email body.  Libtiff home page: http://www.libtiff.org

