Skip to content

Commit

Permalink
bugfix: fail to encode animated GIF from data source. #44
Browse files Browse the repository at this point in the history
  • Loading branch information
ibireme committed Jul 13, 2016
1 parent d099161 commit dfe43e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions YYImage/YYImageCoder.m
Original file line number Diff line number Diff line change
Expand Up @@ -2457,13 +2457,13 @@ - (void)_encodeImageWithDestination:(CGImageDestinationRef)destination imageCoun
} else if ([imageSrc isKindOfClass:[NSURL class]]) {
CGImageSourceRef source = CGImageSourceCreateWithURL((CFURLRef)imageSrc, NULL);
if (source) {
CGImageDestinationAddImageFromSource(destination, source, i, (CFDictionaryRef)frameProperty);
CGImageDestinationAddImageFromSource(destination, source, 0, (CFDictionaryRef)frameProperty);
CFRelease(source);
}
} else if ([imageSrc isKindOfClass:[NSData class]]) {
CGImageSourceRef source = CGImageSourceCreateWithData((CFDataRef)imageSrc, NULL);
if (source) {
CGImageDestinationAddImageFromSource(destination, source, i, (CFDictionaryRef)frameProperty);
CGImageDestinationAddImageFromSource(destination, source, 0, (CFDictionaryRef)frameProperty);
CFRelease(source);
}
}
Expand Down

1 comment on commit dfe43e3

@CoderDuMeng
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good

Please sign in to comment.