Hi Patrick, I have reviewed your latest rev of ReaderWriterTIFF.cpp and this achieves something very similar to my own revision but feel that my revision is a little more readable. I have modified my version to pass the 0 as the estimate in the TIFFDefaultStripSize call to be consistent with your implementation.
I have now checked in this revision to OSG-svn/trunk, 3.4 and 3.2 branches. Could you please test. Cheers, Robert On 18 July 2015 at 22:43, Patrick Neary <[email protected]> wrote: > Robert, I have attached a tested version that works for us. Apparently > TIFFDefaultStripSize needs ImageWidth, BitsPerSample, SamplesPerPixel and > any compression-specific tags set before it can be called to compute a valid > result. Note that we also changed the -1 in the TIFFDefaultStripSize call > to 0 because of a compiler conversion to uint warning. The TIFF docs say > this is supposed to be a uint32 that is set to 0 if you want the function to > compute the best value. > > Thanks, > > --Patrick > > > On Fri, Jul 17, 2015 at 7:57 PM, Farshid Lashkari <[email protected]> wrote: >> >> Hi Robert, >> >> Sorry, I don't remember the reason for commenting those lines out. My >> memory isn't what it used to be :) >> >> I'm guessing I was experimenting with various fields and simply forgot to >> remove those lines. I just tried uncommenting the lines and it didn't appear >> to make any difference when writing out a standard RGB image. >> >> Cheers, >> Farshid >> >> >> On Thu, Jul 16, 2015 at 12:39 PM, Robert Osfield >> <[email protected]> wrote: >>> >>> Hi Patrick (and Farshid), >>> >>> I have just done a first pass review and noticed that you have >>> commented back in the lines: >>> >>> //uint32 rowsperstrip = TIFFDefaultStripSize(image, -1); >>> //TIFFSetField(image, TIFFTAG_ROWSPERSTRIP, rowsperstrip); >>> >>> I've checked the archives and these were actually commented out right >>> in the first submission of the tiff write code that Farshid Lashkari >>> wrote back in 2006: >>> >>> >>> https://github.com/openscenegraph/osg/commit/d5063c3d0c0127577e9d2e9a85ec69bf59a569b4 >>> >>> I haven't worked specifically with this bit of code so can't on >>> Farshid's motivation for commenting out these lines, it may be have >>> been that the lines made no difference at that time, but it could also >>> be that it's inclusion caused a problem. I've added Farshid into this >>> reply to get feedback from him. >>> >>> What is your reason for for commenting these lines in? >>> >>> Robert. >>> >>> >>> On 16 July 2015 at 19:53, Patrick Neary <[email protected]> wrote: >>> > To the tiff plugin, add the capability to write tiff images with >>> > unsigned >>> > short data >>> > >>> > >>> > >>> > _______________________________________________ >>> > osg-submissions mailing list >>> > [email protected] >>> > >>> > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org >>> > >> >> >> >> _______________________________________________ >> osg-submissions mailing list >> [email protected] >> >> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org >> > _______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
