Thanks Glenn, changes look clean and work nicely so are now merged and submitted to svn/trunk.
On Tue, Mar 24, 2009 at 7:21 PM, Glenn Waldron <[email protected]> wrote: > Robert, > > Here is a first cut at the mime-type support we discussed a little while > ago > ( > http://www.mail-archive.com/[email protected]/msg23098.html > ) > > Background: when you access a file over HTTP, you cannot rely on a file > extension being present; instead the file's mime-type is conveyed in the > HTTP Content-Type response header. This facility adds a > mime-type-to-extension map to the registry to handle this. > > There are two new osgDB::Registry functions which are pretty > self-explanatory: > > void addMimeTypeExtensionMapping( mime-type, extension ) > ReaderWriter* getReaderWriterForMimeType( mime-type ) > > I also added the file osgDB/MimeTypes.cpp which houses a hard-coded list of > built-in types. I took the list from here ( > http://www.webmaster-toolkit.com/mime-types.shtml) and then pared it down > to include mostly image and video types, editing them to map to existing > plugins where possible. > > In addition, I updated the CURL plugin to a) install a set of built-in > mime-type mappings, and b) use them to look up an extension in the event > that the target filename does not have an extension. > > Here is a test case. This URL pulls down a JPEG (without a file extension): > osgviewer --image " > http://us.maps3.yimg.com/aerial.maps.yimg.com/ximg?v=1.8&s=256&t=a&r=1&x=0&y=0&z=2 > " > > (Note: MimeTypes.cpp and CMakeLists.txt go in src/osgDB) > > > Glenn Waldron : Pelican Mapping : http://pelicanmapping.com : > +1.703.652.4791 > > _______________________________________________ > osg-submissions mailing list > [email protected] > > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org > >
_______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
