Skip to content

Commit

Permalink
Fix sd_animatedImageByScalingAndCroppingToSize:
Browse files Browse the repository at this point in the history
  • Loading branch information
atsusy committed Sep 2, 2015
1 parent 5a5c65d commit 46c5918
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions SDWebImage/UIImage+GIF.m
Expand Up @@ -141,17 +141,17 @@ - (UIImage *)sd_animatedImageByScalingAndCroppingToSize:(CGSize)size {

NSMutableArray *scaledImages = [NSMutableArray array];

UIGraphicsBeginImageContextWithOptions(size, NO, 0.0);

for (UIImage *image in self.images) {
UIGraphicsBeginImageContextWithOptions(size, NO, 0.0);

[image drawInRect:CGRectMake(thumbnailPoint.x, thumbnailPoint.y, scaledSize.width, scaledSize.height)];
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();

[scaledImages addObject:newImage];
}

UIGraphicsEndImageContext();

UIGraphicsEndImageContext();
}

return [UIImage animatedImageWithImages:scaledImages duration:self.duration];
}

Expand Down

0 comments on commit 46c5918

Please sign in to comment.