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 1476f829c4
commit a86c6dc2c6

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
{
std::string ext = osgDB::getFileExtension(fileName);
if (!acceptsExtension(ext)) return WriteResult::FILE_NOT_HANDLED;
if (img.isCompressed())
{
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;
}
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);
if(!fout) return WriteResult::ERROR_IN_WRITING_FILE;