]> git.tdb.fi Git - libs/gui.git/commitdiff
Tweak QuartzLoader a bit
authorMikko Rasa <tdb@tdb.fi>
Thu, 10 Oct 2013 17:58:05 +0000 (20:58 +0300)
committerMikko Rasa <tdb@tdb.fi>
Thu, 10 Oct 2013 17:58:14 +0000 (20:58 +0300)
Apparently OS X 10.5 uses kCGImageStatusReadingHeader, while 10.8 uses
kCGImageStatusIncomplete.  Also check that we actually got an image when
trying to load.

source/graphics/quartz/quartzloader.cpp

index aa11daaedff1fe6def85092da71a16501f55b272..3447f5f0672100e3318214f0392c4db2d4ca5c03 100644 (file)
@@ -82,12 +82,14 @@ bool QuartzLoader::detect(const string &sig)
        CFRelease(data);
        CFRelease(source);
 
-       return status==kCGImageStatusIncomplete;
+       return status==kCGImageStatusIncomplete || status==kCGImageStatusReadingHeader;
 }
 
 void QuartzLoader::load(Image::Data &data)
 {
        CGImageRef image = CGImageSourceCreateImageAtIndex(priv->source, 0, 0);
+       if(!image)
+               throw bad_image_data("null image");
 
        try
        {