Authored by Atsushi Kataoka

Fix sd_animatedImageByScalingAndCroppingToSize:

@@ -141,17 +141,17 @@ @@ -141,17 +141,17 @@
141 141
142 NSMutableArray *scaledImages = [NSMutableArray array]; 142 NSMutableArray *scaledImages = [NSMutableArray array];
143 143
144 - UIGraphicsBeginImageContextWithOptions(size, NO, 0.0);  
145 -  
146 for (UIImage *image in self.images) { 144 for (UIImage *image in self.images) {
  145 + UIGraphicsBeginImageContextWithOptions(size, NO, 0.0);
  146 +
147 [image drawInRect:CGRectMake(thumbnailPoint.x, thumbnailPoint.y, scaledSize.width, scaledSize.height)]; 147 [image drawInRect:CGRectMake(thumbnailPoint.x, thumbnailPoint.y, scaledSize.width, scaledSize.height)];
148 UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); 148 UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
149 149
150 [scaledImages addObject:newImage]; 150 [scaledImages addObject:newImage];
151 - }  
152 -  
153 - UIGraphicsEndImageContext();  
154 151
  152 + UIGraphicsEndImageContext();
  153 + }
  154 +
155 return [UIImage animatedImageWithImages:scaledImages duration:self.duration]; 155 return [UIImage animatedImageWithImages:scaledImages duration:self.duration];
156 } 156 }
157 157