Show
Ignore:
Timestamp:
10/03/08 11:22:40 (6 years ago)
Author:
robert
Message:

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.

"

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgPlugins/quicktime/ReaderWriterQT.cpp

    r8933 r8972  
    9191 
    9292        #ifdef QT_HANDLE_IMAGES_ALSO 
    93         supportsExtension("rgb","rgb image format"); 
    94         supportsExtension("rgba","rgba image format"); 
    9593        supportsExtension("jpg","jpg image format"); 
    9694        supportsExtension("jpeg","jpeg image format"); 
     
    139137 
    140138         #ifdef QT_HANDLE_IMAGES_ALSO 
    141          osgDB::equalCaseInsensitive(extension,"rgb") || 
    142          osgDB::equalCaseInsensitive(extension,"rgba") || 
    143139         osgDB::equalCaseInsensitive(extension,"jpg") ||  
    144140         osgDB::equalCaseInsensitive(extension,"jpeg") || 
     
    353349        extmap.insert(std::pair<std::string, OSType>("psd",  kQTFileTypePhotoShop)); 
    354350        extmap.insert(std::pair<std::string, OSType>("sgi",  kQTFileTypeSGIImage)); 
    355         extmap.insert(std::pair<std::string, OSType>("rgb",  kQTFileTypeSGIImage)); 
    356         extmap.insert(std::pair<std::string, OSType>("rgba", kQTFileTypeSGIImage)); 
    357  
     351         
    358352        std::map<std::string, OSType>::iterator cur = extmap.find(ext); 
    359353