Quitened down unsupport compression output when passing in a file with a non rgb extension

This commit is contained in:
Robert Osfield 2018-05-18 12:42:20 +01:00
parent a4c8804b1b
commit ea9be189e8

View File

@ -698,6 +698,9 @@ class ReaderWriterRGB : public osgDB::ReaderWriter
virtual WriteResult writeImage(const osg::Image &img,const std::string& fileName, const osgDB::ReaderWriter::Options*) const virtual WriteResult writeImage(const osg::Image &img,const std::string& fileName, const osgDB::ReaderWriter::Options*) const
{ {
std::string ext = osgDB::getFileExtension(fileName);
if (!acceptsExtension(ext)) return WriteResult::FILE_NOT_HANDLED;
if (img.isCompressed()) if (img.isCompressed())
{ {
OSG_NOTICE<<"Warning: RGB plugin does not supporting writing compressed imagery."<<std::endl; OSG_NOTICE<<"Warning: RGB plugin does not supporting writing compressed imagery."<<std::endl;
@ -709,9 +712,6 @@ class ReaderWriterRGB : public osgDB::ReaderWriter
return WriteResult::ERROR_IN_WRITING_FILE; return WriteResult::ERROR_IN_WRITING_FILE;
} }
std::string ext = osgDB::getFileExtension(fileName);
if (!acceptsExtension(ext)) return WriteResult::FILE_NOT_HANDLED;
osgDB::ofstream fout(fileName.c_str(), std::ios::out | std::ios::binary); osgDB::ofstream fout(fileName.c_str(), std::ios::out | std::ios::binary);
if(!fout) return WriteResult::ERROR_IN_WRITING_FILE; if(!fout) return WriteResult::ERROR_IN_WRITING_FILE;