I upload a black and white png image and I want to access the underlying pixel data. However, after loading the pixel data through the CGImageGetDataProvider, the length of the returned data is longer than expected.
CCGDataProviderRef provider = CGDataProviderCreateWithFilename(cStr);
CGImageRef image = CGImageCreateWithPNGDataProvider(provider, NULL, FALSE, kCGRenderingIntentDefault);
mapWidth = CGImageGetWidth(image);
mapHeight = CGImageGetHeight(image);
lookupMap = CGDataProviderCopyData(CGImageGetDataProvider(image));
mapWidth goes to 1804 and mapHeight goes to 1005. The product of which is 1813020
When i call
CFDataGetLength(lookupMap)
the answer is 1833120.
Where are these extra 20,100 bytes? Any help here is much appreciated. Am I missing something regarding the basic image format?
CFDataRef , ,
: 0 1803 , 20 . , , 1824 1005 1804 1005. - , .