diff --git a/SDWebImage/Core/NSImage+Compatibility.m b/SDWebImage/Core/NSImage+Compatibility.m index 7de0c703..ce67151e 100644 --- a/SDWebImage/Core/NSImage+Compatibility.m +++ b/SDWebImage/Core/NSImage+Compatibility.m @@ -35,8 +35,8 @@ NSImageRep *imageRep = [self bestRepresentationForRect:imageRect context:nil hints:nil]; CGFloat width = imageRep.size.width; CGFloat height = imageRep.size.height; - NSUInteger pixelWidth = imageRep.pixelsWide; - NSUInteger pixelHeight = imageRep.pixelsHigh; + CGFloat pixelWidth = (CGFloat)imageRep.pixelsWide; + CGFloat pixelHeight = (CGFloat)imageRep.pixelsHigh; if (width > 0 && height > 0) { CGFloat widthScale = pixelWidth / width; CGFloat heightScale = pixelHeight / height; diff --git a/SDWebImage/Core/SDImageIOAnimatedCoder.m b/SDWebImage/Core/SDImageIOAnimatedCoder.m index 837e59cd..d4d739ec 100644 --- a/SDWebImage/Core/SDImageIOAnimatedCoder.m +++ b/SDWebImage/Core/SDImageIOAnimatedCoder.m @@ -191,8 +191,8 @@ static NSString * kSDCGImageDestinationRequestedFileSize = @"kCGImageDestination // Some options need to pass to `CGImageSourceCopyPropertiesAtIndex` before `CGImageSourceCreateImageAtIndex`, or ImageIO will ignore them because they parse once :) // Parse the image properties NSDictionary *properties = (__bridge_transfer NSDictionary *)CGImageSourceCopyPropertiesAtIndex(source, index, (__bridge CFDictionaryRef)options); - NSUInteger pixelWidth = [properties[(__bridge NSString *)kCGImagePropertyPixelWidth] unsignedIntegerValue]; - NSUInteger pixelHeight = [properties[(__bridge NSString *)kCGImagePropertyPixelHeight] unsignedIntegerValue]; + CGFloat pixelWidth = [properties[(__bridge NSString *)kCGImagePropertyPixelWidth] doubleValue]; + CGFloat pixelHeight = [properties[(__bridge NSString *)kCGImagePropertyPixelHeight] doubleValue]; CGImagePropertyOrientation exifOrientation = (CGImagePropertyOrientation)[properties[(__bridge NSString *)kCGImagePropertyOrientation] unsignedIntegerValue]; if (!exifOrientation) { exifOrientation = kCGImagePropertyOrientationUp; @@ -503,8 +503,8 @@ static NSString * kSDCGImageDestinationRequestedFileSize = @"kCGImageDestination maxPixelSize = maxPixelSizeValue.CGSizeValue; #endif } - NSUInteger pixelWidth = CGImageGetWidth(imageRef); - NSUInteger pixelHeight = CGImageGetHeight(imageRef); + CGFloat pixelWidth = (CGFloat)CGImageGetWidth(imageRef); + CGFloat pixelHeight = (CGFloat)CGImageGetHeight(imageRef); CGFloat finalPixelSize = 0; if (maxPixelSize.width > 0 && maxPixelSize.height > 0 && pixelWidth > maxPixelSize.width && pixelHeight > maxPixelSize.height) { CGFloat pixelRatio = pixelWidth / pixelHeight; diff --git a/SDWebImage/Core/SDImageIOCoder.m b/SDWebImage/Core/SDImageIOCoder.m index d858125d..8e1199f4 100644 --- a/SDWebImage/Core/SDImageIOCoder.m +++ b/SDWebImage/Core/SDImageIOCoder.m @@ -250,8 +250,8 @@ static NSString * kSDCGImageDestinationRequestedFileSize = @"kCGImageDestination maxPixelSize = maxPixelSizeValue.CGSizeValue; #endif } - NSUInteger pixelWidth = CGImageGetWidth(imageRef); - NSUInteger pixelHeight = CGImageGetHeight(imageRef); + CGFloat pixelWidth = (CGFloat)CGImageGetWidth(imageRef); + CGFloat pixelHeight = (CGFloat)CGImageGetHeight(imageRef); if (maxPixelSize.width > 0 && maxPixelSize.height > 0 && pixelWidth > maxPixelSize.width && pixelHeight > maxPixelSize.height) { CGFloat pixelRatio = pixelWidth / pixelHeight; CGFloat maxPixelSizeRatio = maxPixelSize.width / maxPixelSize.height; diff --git a/SDWebImage/Core/UIView+WebCache.m b/SDWebImage/Core/UIView+WebCache.m index 11588502..35f10362 100644 --- a/SDWebImage/Core/UIView+WebCache.m +++ b/SDWebImage/Core/UIView+WebCache.m @@ -12,6 +12,7 @@ #import "SDWebImageError.h" #import "SDInternalMacros.h" #import "SDWebImageTransitionInternal.h" +#import "SDImageCache.h" const int64_t SDWebImageProgressUnitCountUnknown = 1LL;