I'm using the iPhone port of ImageMagick. I'm trying to loop through the frames of an animated gif and turn each frame into an UIImage. I know I can init a UIImage with NSData which I can init with a const void *. So how to I get the buffer and length of the image?
Here's the code:
MagickReadImage(wand, filename);
while(MagickHasNextImage(wand)) {
Image *myImage = GetImageFromMagickWand(wand);
//HELP ME PLEASE
const void *myBuff =myImage->blob; //guessing this is the right way to get the buffer?
int myLength = ????? //no idea how to get the length
NSData *myData = [[NSData alloc] initWithBytes:myBuff length:myLength];
UIImage myImage = [[UIImage alloc] initWithData:myData]];
MagickNextImage(wand);
}