diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/raw2tiff.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/raw2tiff.c b/tools/raw2tiff.c index e21119c3..1963baf6 100644 --- a/tools/raw2tiff.c +++ b/tools/raw2tiff.c @@ -1,4 +1,4 @@ -/* $Id: raw2tiff.c,v 1.21 2006-02-07 11:08:31 dron Exp $ +/* $Id: raw2tiff.c,v 1.22 2006-03-15 12:48:24 dron Exp $ * * Project: libtiff tools * Purpose: Convert raw byte sequences in TIFF images @@ -270,8 +270,13 @@ main(int argc, char* argv[]) } bufsize = width * nbands * depth; buf1 = (unsigned char *)_TIFFmalloc(bufsize); - TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, - TIFFDefaultStripSize(out, rowsperstrip)); + + rowsperstrip = TIFFDefaultStripSize(out, rowsperstrip); + if (rowsperstrip > length) { + rowsperstrip = length; + } + TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, rowsperstrip ); + lseek(fd, hdr_size, SEEK_SET); /* Skip the file header */ for (row = 0; row < length; row++) { switch(interleaving) { |