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:
commit
3af1a30ebb
|
@ -141,17 +141,17 @@
|
||||||
|
|
||||||
NSMutableArray *scaledImages = [NSMutableArray array];
|
NSMutableArray *scaledImages = [NSMutableArray array];
|
||||||
|
|
||||||
UIGraphicsBeginImageContextWithOptions(size, NO, 0.0);
|
|
||||||
|
|
||||||
for (UIImage *image in self.images) {
|
for (UIImage *image in self.images) {
|
||||||
|
UIGraphicsBeginImageContextWithOptions(size, NO, 0.0);
|
||||||
|
|
||||||
[image drawInRect:CGRectMake(thumbnailPoint.x, thumbnailPoint.y, scaledSize.width, scaledSize.height)];
|
[image drawInRect:CGRectMake(thumbnailPoint.x, thumbnailPoint.y, scaledSize.width, scaledSize.height)];
|
||||||
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
|
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
|
||||||
|
|
||||||
[scaledImages addObject:newImage];
|
[scaledImages addObject:newImage];
|
||||||
|
|
||||||
|
UIGraphicsEndImageContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
UIGraphicsEndImageContext();
|
|
||||||
|
|
||||||
return [UIImage animatedImageWithImages:scaledImages duration:self.duration];
|
return [UIImage animatedImageWithImages:scaledImages duration:self.duration];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue