Robert, I considered that, mapping mime-types to extensions, but shied away from the idea that adding a plugin might require mime-types hard coded into Registry. How would you include support for new types, say in a plugin in an external NodeKit?
Glenn Waldron : Pelican Mapping : http://pelicanmapping.com : +1.703.652.4791 On Mon, Feb 23, 2009 at 9:20 AM, Robert Osfield <robert.osfi...@gmail.com>wrote: > Hi Glenn, > > I'm open to these suggestions, but would prefer to keep the changes to > a minimum in terms of extra code/API. > > Could the mime type simply be mapped to a plugin name? If so then all > we'd need to do to set up a alias list for mime type in addition to > the current extension aliasing that the osgDB::Registry holds. > > Robert. > > On Mon, Feb 23, 2009 at 2:00 PM, Glenn Waldron <gwald...@gmail.com> wrote: > > Robert et al, > > > > I propose that we add a facility to look up plugins by mime-type (in > > addition to looking up by extension). > > > > The existing mechanism works fine for local files. But when accessing > data > > via a URL (with the CURL plugin or by some other means), it is often the > > case that you can only divine the content type by means of a mime-type in > > the HTTP "Content-Type" header, and that no file extension is available. > > > > Here's a possible implementation: > > > > 1) Add a method Registry::getReaderWriterForMimeType(). > > > > 2) Add a method ReaderWriter::supportsMimeType() so that plugins can > > register their support for various mime-types. > > > > 3) Update various plugins to call supportsMimeType() as appropriate. > > > > 4) Update the CURL plugin so that it checks the "Content-Type" HTTP > header, > > calls getReaderWriterForMimeType(), and if that fails then calls > > getReaderWriterForExtension(). (I might have that backwards.) > > > > Thoughts? > > > > > > Glenn Waldron : Pelican Mapping : http://pelicanmapping.com : > > +1.703.652.4791 > > > > _______________________________________________ > > 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 mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org