Re: [osg-users] [osgPlugins] osgDB::readImageFile() chooses ffmpeg over libpng
I'm working on this today.. And I've noticed.. it's not just .png files. If I use osgdb_ffmpeg, it takes over ALL images. I'm attempting to walk through the call stack.. Code: starting here... Registry.cpp - line 992 ReadImageFunctor(const std::string filename, const Options* options):ReadFunctor(filename,options) {} ending up here... ReaderWriterFFmpeg.cpp - line 136 virtual ReadResult readImage(const std::string filename, const osgDB::ReaderWriter::Options* options) const It appears that the plugins are iterated and FFMPEG is allways selected for ReadImage() I'm having a hard time locating where exactly the plugin is selected. [/code] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=63962#63962 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPlugins] osgDB::readImageFile() chooses ffmpeg over libpng
My fix for this: Upon inspection of ReaderWriterPNG.cpp line - 371 Code: virtual ReadResult readImage(const std::string file, const osgDB::ReaderWriter::Options* options) const { std::string ext = osgDB::getLowerCaseFileExtension(file); if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED; . . . if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED; seems to filter the plugin's accepted extensions. I've altered ReaderWriterFFmpeg.cpp to include this as well.. Code: line - 135 virtual ReadResult readImage(const std::string filename, const osgDB::ReaderWriter::Options* options) const { const std::string ext = osgDB::getLowerCaseFileExtension(filename); if (!acceptsExtension(ext)) return ReadResult::FILE_NOT_HANDLED; . . . Not sure if this is the proper fix.. but it works for me. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=63963#63963 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPlugins] osgDB::readImageFile() chooses ffmpeg over libpng
Hi Paul, This sounds like a bug, the ffmpeg plugin should not attempt to load a png file. What exactly happens? As for changing the order, simple pre load the png plugin as this will ensure it gets called first thanks to the Chain-Of-Responsibility pattern used by it. Robert On 10 May 2015 at 23:49, Paul aquawic...@hotmail.com wrote: OSG-3.3.7 both plugins osgdb_png and osgdb_ffmpeg loaded. osgDB::readImageFile(image.png) chooses ffmpeg over libpng to load .png image files. I checked ReaderWriterFFmpeg.cpp, and it does not add the .png extention. How do I give libpng priority on .png files. Thanks :) -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=63688#63688 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [osgPlugins] osgDB::readImageFile() chooses ffmpeg over libpng
OSG-3.3.7 both plugins osgdb_png and osgdb_ffmpeg loaded. osgDB::readImageFile(image.png) chooses ffmpeg over libpng to load .png image files. I checked ReaderWriterFFmpeg.cpp, and it does not add the .png extention. How do I give libpng priority on .png files. Thanks :) -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=63688#63688 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org