Fix the encoding maxPixelSize logic (patch)
This commit is contained in:
parent
87551c267a
commit
eefd749a1f
|
@ -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