From Laurens Voerman,"the current ReaderWriterJP2 has all the code for writing jp2 files (jpeg 2000), but the writing fails on my windows machine (jasper-1.900.1) because the ID for the "jp2" extention is requested before the jas_init() call. (bug introduced in svn 7645 - 10 dec 2007)"

This commit is contained in:
Robert Osfield
2010-01-11 14:28:33 +00:00
parent 22a63fa5b7
commit 5dad3a0afb

View File

@@ -179,9 +179,11 @@ class ReaderWriterJP2 : public osgDB::ReaderWriter
// little dance here to get around warnings created by jas_image_strtofmt use of char* rather than const char*
// as a parameted and modern compilers deprecating "jp2" string being treated as char*.
jas_init();//jas_image_strtofmt() bound to return -1 if jas_init has not been called.
char* jp2 = strdup("jp2");
_fmt_jp2 = jas_image_strtofmt(jp2);
free(jp2);
jas_image_clearfmts();
}
virtual const char* className() const { return "RGB Image Reader/Writer"; }