Merge pull request #66 from SDWebImage/fix_encode_maxPixelSize
Fix the encoding maxPixelSize logic (patch)
This commit is contained in:
commit
2a6c8fac7d
|
@ -860,7 +860,7 @@ static CGSize SDCalculateThumbnailSize(CGSize fullSize, BOOL preserveAspectRatio
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if need to scale pixel size
|
// Check if need to scale pixel size
|
||||||
if (maxPixelSize.width > 0 && maxPixelSize.height > 0 && width > maxPixelSize.width && height > maxPixelSize.height) {
|
if (maxPixelSize.width > 0 && maxPixelSize.height > 0 && (width > maxPixelSize.width || height > maxPixelSize.height)) {
|
||||||
CGSize scaledSize = SDCalculateThumbnailSize(CGSizeMake(width, height), YES, maxPixelSize);
|
CGSize scaledSize = SDCalculateThumbnailSize(CGSizeMake(width, height), YES, maxPixelSize);
|
||||||
result = WebPPictureRescale(&picture, scaledSize.width, scaledSize.height);
|
result = WebPPictureRescale(&picture, scaledSize.width, scaledSize.height);
|
||||||
if (!result) {
|
if (!result) {
|
||||||
|
|
Loading…
Reference in New Issue