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.

"
This commit is contained in:
Robert Osfield 2008-10-03 09:22:40 +00:00
parent 4bde492d8c
commit 830bb21a32

View File

@ -90,8 +90,6 @@ public:
supportsExtension("live","Live video streaming"); supportsExtension("live","Live video streaming");
#ifdef QT_HANDLE_IMAGES_ALSO #ifdef QT_HANDLE_IMAGES_ALSO
supportsExtension("rgb","rgb image format");
supportsExtension("rgba","rgba image format");
supportsExtension("jpg","jpg image format"); supportsExtension("jpg","jpg image format");
supportsExtension("jpeg","jpeg image format"); supportsExtension("jpeg","jpeg image format");
supportsExtension("tif","tif image format"); supportsExtension("tif","tif image format");
@ -138,8 +136,6 @@ public:
return return
#ifdef QT_HANDLE_IMAGES_ALSO #ifdef QT_HANDLE_IMAGES_ALSO
osgDB::equalCaseInsensitive(extension,"rgb") ||
osgDB::equalCaseInsensitive(extension,"rgba") ||
osgDB::equalCaseInsensitive(extension,"jpg") || osgDB::equalCaseInsensitive(extension,"jpg") ||
osgDB::equalCaseInsensitive(extension,"jpeg") || osgDB::equalCaseInsensitive(extension,"jpeg") ||
osgDB::equalCaseInsensitive(extension,"tif") || osgDB::equalCaseInsensitive(extension,"tif") ||
@ -352,9 +348,7 @@ public:
extmap.insert(std::pair<std::string, OSType>("gif", kQTFileTypeGIF)); extmap.insert(std::pair<std::string, OSType>("gif", kQTFileTypeGIF));
extmap.insert(std::pair<std::string, OSType>("psd", kQTFileTypePhotoShop)); extmap.insert(std::pair<std::string, OSType>("psd", kQTFileTypePhotoShop));
extmap.insert(std::pair<std::string, OSType>("sgi", kQTFileTypeSGIImage)); extmap.insert(std::pair<std::string, OSType>("sgi", kQTFileTypeSGIImage));
extmap.insert(std::pair<std::string, OSType>("rgb", kQTFileTypeSGIImage));
extmap.insert(std::pair<std::string, OSType>("rgba", kQTFileTypeSGIImage));
std::map<std::string, OSType>::iterator cur = extmap.find(ext); std::map<std::string, OSType>::iterator cur = extmap.find(ext);
// can not handle this type of file, perhaps a movie? // can not handle this type of file, perhaps a movie?