Fix the encoding maxPixelSize logic (patch)

This commit is contained in:
DreamPiggy 2022-06-22 17:00:21 +08:00
parent 87551c267a
commit eefd749a1f
1 changed files with 1 additions and 1 deletions

View File

@ -860,7 +860,7 @@ static CGSize SDCalculateThumbnailSize(CGSize fullSize, BOOL preserveAspectRatio
}
// 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);
result = WebPPictureRescale(&picture, scaledSize.width, scaledSize.height);
if (!result) {