Hi,
I got a bitmapData full of zeros after creating a NSImage
with initWithContentsOfURL
on a HEIF RGB image with 10 bits per component (bitsPerPixel is 40). The image is correctly displayed by the Finder and Preview.
If I convert the bitmap representation with:
CGImageRef cgImage = imageRep.CGImage;
CGDataProviderRef provider = CGImageGetDataProvider(cgImage);
CFDataRef data = CGDataProviderCopyData(provider);
... the subsequent CFData contains non-zero bytes.
The call to CGDataProviderCopyData
is not free and takes some time, as if there is some kind of unpacking process.
I do not have such a null content with any other kind of image.
Is there something I forgot before calling bitmapData
?
Thanks.