mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-25 01:47:31 +09:00
Sync libwebp sources with https://chromium.googlesource.com/webm/libwebp/+/v1.0.0
This commit is contained in:
parent
96f65ed0eb
commit
57e9b57974
86 changed files with 3796 additions and 2250 deletions
|
|
@ -15,7 +15,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "../dsp/dsp.h"
|
||||
#include "./rescaler_utils.h"
|
||||
#include "../utils/rescaler_utils.h"
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
|
@ -85,11 +85,13 @@ int WebPRescalerGetScaledDimensions(int src_width, int src_height,
|
|||
|
||||
// if width is unspecified, scale original proportionally to height ratio.
|
||||
if (width == 0) {
|
||||
width = (src_width * height + src_height / 2) / src_height;
|
||||
width =
|
||||
(int)(((uint64_t)src_width * height + src_height / 2) / src_height);
|
||||
}
|
||||
// if height is unspecified, scale original proportionally to width ratio.
|
||||
if (height == 0) {
|
||||
height = (src_height * width + src_width / 2) / src_width;
|
||||
height =
|
||||
(int)(((uint64_t)src_height * width + src_width / 2) / src_width);
|
||||
}
|
||||
// Check if the overall dimensions still make sense.
|
||||
if (width <= 0 || height <= 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue