Apparently OS X 10.5 uses kCGImageStatusReadingHeader, while 10.8 uses
kCGImageStatusIncomplete. Also check that we actually got an image when
trying to load.
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
{