From 5dad3a0afbd1999b0e2210deabb49830c21e9090 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 11 Jan 2010 14:28:33 +0000 Subject: [PATCH] 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)" --- src/osgPlugins/jp2/ReaderWriterJP2.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/osgPlugins/jp2/ReaderWriterJP2.cpp b/src/osgPlugins/jp2/ReaderWriterJP2.cpp index 1bf770cd4..27cd58f90 100644 --- a/src/osgPlugins/jp2/ReaderWriterJP2.cpp +++ b/src/osgPlugins/jp2/ReaderWriterJP2.cpp @@ -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"; }