Merge pull request #1280 from atsusy/fix-uiimage-gif

```UIGraphicsBeginImageContextWithOptions``` and ```UIGraphicsEndImageContext``` should be inside the loop for each image
This commit is contained in:
Konstantinos K. 2015-09-29 09:18:33 +03:00
commit 3af1a30ebb
1 changed files with 5 additions and 5 deletions

View File

@ -141,16 +141,16 @@
NSMutableArray *scaledImages = [NSMutableArray array];
for (UIImage *image in self.images) {
UIGraphicsBeginImageContextWithOptions(size, NO, 0.0);
for (UIImage *image in self.images) {
[image drawInRect:CGRectMake(thumbnailPoint.x, thumbnailPoint.y, scaledSize.width, scaledSize.height)];
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
[scaledImages addObject:newImage];
}
UIGraphicsEndImageContext();
}
return [UIImage animatedImageWithImages:scaledImages duration:self.duration];
}