OpenSceneGraph/include/osgDB
Robert Osfield 38b02a26a9 From Glenn Waldron, "Here is a first cut at the mime-type support we discussed a little while ago
(http://www.mail-archive.com/osg-users@lists.openscenegraph.org/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"
"
2009-04-09 14:00:16 +00:00
..
Archive Renamed Archive::ArchiveStatus to ReaderWriter::ArchiveStatus 2008-07-15 14:15:42 +00:00
AuthenticationMap Moved AuthenticalMap/AuthenticationDetails out in their own files 2008-07-17 12:13:04 +00:00
ConvertUTF Where possible moved redundent C header includes from headers to source files 2008-12-12 18:47:30 +00:00
DatabasePager From Csaba Halasz, "here is another division by zero fix, this should be simpler ;) 2009-03-23 15:47:01 +00:00
DotOsgWrapper Where possible moved redundent C header includes from headers to source files 2008-12-12 18:47:30 +00:00
DynamicLibrary Updated copyright years. 2006-07-18 15:21:48 +00:00
Export From Roland Smeenk, "Attached you will find a large set of small typo fixes (mainly in the comments)." 2007-12-10 17:30:18 +00:00
Field Where possible moved redundent C header includes from headers to source files 2008-12-12 18:47:30 +00:00
FieldReader Where possible moved redundent C header includes from headers to source files 2008-12-12 18:47:30 +00:00
FieldReaderIterator Updated copyright years. 2006-07-18 15:21:48 +00:00
FileCache Introduce osgDB::FileCache, and updated osgfilecache and DatabasePager to use it. 2008-10-20 16:24:57 +00:00
FileNameUtils From Stephan Huber, 2009-03-10 12:21:13 +00:00
FileUtils From Andy Skinner, fixes for Solaris build 2009-01-09 12:17:40 +00:00
fstream Merged in various changes from the OSG-2.8 to being svn/trunk up to date. 2009-02-19 14:24:10 +00:00
ImageOptions From Mike Wittman, fix to CopyOp&. 2007-04-12 09:32:34 +00:00
ImagePager Updated to reflect changes in NodeVistor::ImageRequestHandler. 2008-10-06 17:02:56 +00:00
Input From Art Trevs, add support for saving external shader files. 2008-03-04 14:04:48 +00:00
Output From Michael Platings, Converted std::fstream/ifstream/ofstream to osgDB::fstream/ifstream/ofstream and 2008-11-07 15:08:08 +00:00
ParameterOutput Fixed warnings 2009-01-07 10:32:59 +00:00
PluginQuery From Ralf Habacker, "The appended patch fixes this issue by adding a virtual method named supportedFeatures() to the class ReaderWriter, which could be overriden by a specific plugin to adjust the set of features. 2009-03-10 15:00:39 +00:00
ReaderWriter Completed support for automatic detection of plugin features. 2009-03-10 17:27:39 +00:00
ReadFile Added convinience methods for parse shader source files 2008-09-25 14:41:06 +00:00
Registry From Glenn Waldron, "Here is a first cut at the mime-type support we discussed a little while ago 2009-04-09 14:00:16 +00:00
Serializer Moved Serializer header from VPB into osgDB. 2008-09-18 15:50:22 +00:00
SharedStateManager Introduce NodeVisitor::className and libraryName() 2008-12-17 12:13:15 +00:00
Version From David Callu, improved consistency of Version strings and add version support 2007-09-05 17:12:24 +00:00
WriteFile From Art Trevs, add support for saving external shader files. 2008-03-04 14:04:48 +00:00