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

Reply via email to