diff --git a/SDWebImage/MKAnnotationView+WebCache.m b/SDWebImage/MKAnnotationView+WebCache.m index 0fe94570..affc6779 100644 --- a/SDWebImage/MKAnnotationView+WebCache.m +++ b/SDWebImage/MKAnnotationView+WebCache.m @@ -64,7 +64,10 @@ - (void)cancelCurrentImageLoad { - [[SDWebImageManager sharedManager] cancelForDelegate:self]; + @synchronized(self) + { + [[SDWebImageManager sharedManager] cancelForDelegate:self]; + } } - (void)webImageManager:(SDWebImageManager *)imageManager didProgressWithPartialImage:(UIImage *)image forURL:(NSURL *)url diff --git a/SDWebImage/SDWebImageCompat.h b/SDWebImage/SDWebImageCompat.h index 82d4c0ad..5fb9889a 100644 --- a/SDWebImage/SDWebImageCompat.h +++ b/SDWebImage/SDWebImageCompat.h @@ -83,7 +83,7 @@ NS_INLINE UIImage *SDScaledImageForPath(NSString *path, NSObject *imageOrData) } } - UIImage *scaledImage = [[UIImage alloc] initWithCGImage:image.CGImage scale:scale orientation:UIImageOrientationUp]; + UIImage *scaledImage = [[UIImage alloc] initWithCGImage:image.CGImage scale:scale orientation:image.imageOrientation]; SDWISafeRelease(image) image = scaledImage; } diff --git a/SDWebImage/UIButton+WebCache.m b/SDWebImage/UIButton+WebCache.m index 2b61c1a8..be6d3355 100644 --- a/SDWebImage/UIButton+WebCache.m +++ b/SDWebImage/UIButton+WebCache.m @@ -129,7 +129,10 @@ - (void)cancelCurrentImageLoad { - [[SDWebImageManager sharedManager] cancelForDelegate:self]; + @synchronized(self) + { + [[SDWebImageManager sharedManager] cancelForDelegate:self]; + } } - (void)webImageManager:(SDWebImageManager *)imageManager didProgressWithPartialImage:(UIImage *)image forURL:(NSURL *)url userInfo:(NSDictionary *)info diff --git a/SDWebImage/UIImageView+WebCache.m b/SDWebImage/UIImageView+WebCache.m index 090c82cd..de785ca7 100644 --- a/SDWebImage/UIImageView+WebCache.m +++ b/SDWebImage/UIImageView+WebCache.m @@ -64,7 +64,10 @@ - (void)cancelCurrentImageLoad { - [[SDWebImageManager sharedManager] cancelForDelegate:self]; + @synchronized(self) + { + [[SDWebImageManager sharedManager] cancelForDelegate:self]; + } } - (void)webImageManager:(SDWebImageManager *)imageManager didProgressWithPartialImage:(UIImage *)image forURL:(NSURL *)url