CGImageSourceRef source0 = CGImageSourceCreateWithURL((CFURLRef)[NSURL URLWithString:_item.permalink], NULL);
CFDataRef dataRef = CGDataProviderCopyData(CGImageGetDataProvider(aImage.CGImage));
CGImageSourceRef source = CGImageSourceCreateWithData(dataRef, NULL);
NSLog(@"source = %@ + %@",source,source0);
NSDictionary* properties = (NSDictionary*)CGImageSourceCopyProperties(source, NULL);
NSDictionary* gifProperties = [properties objectForKey:(NSString*)kCGImagePropertyGIFDictionary];
NSLog(@"properties: %@,gifProperties: %@, source = %@",properties,gifProperties,CGImageSourceGetType(source));
if (gifProperties != nil && [@"com.compuserve.gif" isEqualToString:[NSString stringWithFormat:@"%@",CGImageSourceGetType(source)]]) {
_imgGIF = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"GIF.png"]];
[_imgGIF setFrame:CGRectMake(photoIV.frame.size.width - 5.0f - _imgGIF.width, photoIV.frame.size.height - 5.0f - _imgGIF.height, _imgGIF.width, _imgGIF.height)];
[photoIV addSubview:_imgGIF];
} else {
_imgGIF = nil;
}
iOS 判断gif图
最新推荐文章于 2022-08-03 17:21:40 发布