From 830bb21a32bf9826c2f1a5fa39773caca72bd32b Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 3 Oct 2008 09:22:40 +0000 Subject: [PATCH] From Tatsuhiro Nishioka, submissions posted by Stephan Huber, "attached you'll find a modified ReaderWriterQT.cpp-file where I removed the support for rgb(a)-files. Quicktime supports only files with 3/4-channels rgba-files and not 1/2-channels rgb-files. This submission is from Tatsuhiro Nishioka, here's his original quote: When FlightGear crashes, the error message "GraphicsImportGetNaturalBounds failed" shows up. By adding printf debug, I found the error was -8969: codecBadDataErr when loading a gray-scaled (2 channels) rgba files even though the file can be loaded with Gimp and osgViewer properly. So I made an investigation on this problem and found an interesting thing. This error occurs only when non-rgb files are loaded before rgb files. The reason is that rgba files can be handled by both osgdb_rgb.so and osgdb_qt.so, but the error happens only when osgdb_qt.so try to load a gray-scaled rgba file. When a program is about to load an rgba file, osgdb_rgb.so is loaded and it handles the rgba file properly. In contrast, when a gray-scaled rgb file is being loaded after a non-rgb file (say png) is already loaded by osgdb_qt.so, osgdb_qt.so tries to load the file instead of osgdb_rgb, which causes the error above. Anyway, the bad thing is that QuickTime cannot handle gray-scaled rgb files properly. The solution for this is not to let osgdb_qt handle rgb files since osgdb_rgb can handle these properly. " --- src/osgPlugins/quicktime/ReaderWriterQT.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/osgPlugins/quicktime/ReaderWriterQT.cpp b/src/osgPlugins/quicktime/ReaderWriterQT.cpp index c5691b5e5..20c78d477 100644 --- a/src/osgPlugins/quicktime/ReaderWriterQT.cpp +++ b/src/osgPlugins/quicktime/ReaderWriterQT.cpp @@ -90,8 +90,6 @@ public: supportsExtension("live","Live video streaming"); #ifdef QT_HANDLE_IMAGES_ALSO - supportsExtension("rgb","rgb image format"); - supportsExtension("rgba","rgba image format"); supportsExtension("jpg","jpg image format"); supportsExtension("jpeg","jpeg image format"); supportsExtension("tif","tif image format"); @@ -138,8 +136,6 @@ public: return #ifdef QT_HANDLE_IMAGES_ALSO - osgDB::equalCaseInsensitive(extension,"rgb") || - osgDB::equalCaseInsensitive(extension,"rgba") || osgDB::equalCaseInsensitive(extension,"jpg") || osgDB::equalCaseInsensitive(extension,"jpeg") || osgDB::equalCaseInsensitive(extension,"tif") || @@ -352,9 +348,7 @@ public: extmap.insert(std::pair("gif", kQTFileTypeGIF)); extmap.insert(std::pair("psd", kQTFileTypePhotoShop)); extmap.insert(std::pair("sgi", kQTFileTypeSGIImage)); - extmap.insert(std::pair("rgb", kQTFileTypeSGIImage)); - extmap.insert(std::pair("rgba", kQTFileTypeSGIImage)); - + std::map::iterator cur = extmap.find(ext); // can not handle this type of file, perhaps a movie?