CGImageSourceCreateWithURL return always nil. I am passing [NSURL fileURLWithPath:getImagePath]. I have double check that image is there with url i am passing. Please find out the code below.
NSURL *imageURL = [self getImageAtTime:i withTitle:@"gifImage"];
if (!imageURL) {
NSLog(@"imageURL is null");
return;
}
CGImageSourceRef source = CGImageSourceCreateWithURL((__bridge CFURLRef)imageURL, NULL);
if (source == NULL) {
NSLog(@"Source is NULL");
}
CGImageDestinationAddImageFromSource(destination, source, i+1, (__bridge CFDictionaryRef)frameProperties);
while creating
CGImageSourceRef source = CGImageSourceCreateWithURL((__bridge CFURLRef)imageURL, NULL);i just forgot to specify property of image. Here is the below working code of CGImageSourceCreateWithURL