From bddbdfdefe9419e5d3dc28142ae3e2b67fd1168a Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sun, 19 Jul 2015 09:51:27 +0000 Subject: [PATCH] Reinstated the TIFFSetField(image, TIFFTAG_ROWSPERSTRIP, rowsperstrip); git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14987 16af8721-9629-0410-8352-f15c8da7e697 --- src/osgPlugins/tiff/ReaderWriterTIFF.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/osgPlugins/tiff/ReaderWriterTIFF.cpp b/src/osgPlugins/tiff/ReaderWriterTIFF.cpp index 115be26c9..dffbcd7f5 100644 --- a/src/osgPlugins/tiff/ReaderWriterTIFF.cpp +++ b/src/osgPlugins/tiff/ReaderWriterTIFF.cpp @@ -908,10 +908,12 @@ class ReaderWriterTIFF : public osgDB::ReaderWriter break; } + uint32 rowsperstrip = 0; + switch(img.getDataType()){ case GL_FLOAT: TIFFSetField(image, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_IEEEFP); - TIFFSetField(image, TIFFTAG_ROWSPERSTRIP, 1); + rowsperstrip = 1; bitsPerSample = 32; break; case GL_SHORT: @@ -935,9 +937,9 @@ class ReaderWriterTIFF : public osgDB::ReaderWriter TIFFSetField(image, TIFFTAG_COMPRESSION, compressionType); TIFFSetField(image, TIFFTAG_FILLORDER, FILLORDER_MSB2LSB); TIFFSetField(image, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); - - //uint32 rowsperstrip = TIFFDefaultStripSize(image, -1); - //TIFFSetField(image, TIFFTAG_ROWSPERSTRIP, rowsperstrip); + + if (rowsperstrip==0) rowsperstrip = TIFFDefaultStripSize(image, 0); + TIFFSetField(image, TIFFTAG_ROWSPERSTRIP, rowsperstrip); // Write the information to the file for(int i = 0; i < img.t(); ++i) {