mirror of
https://github.com/lovell/sharp.git
synced 2025-07-11 19:40:14 +02:00
Silence Windows compiler warnings #19
This commit is contained in:
parent
fb1c9cf3d3
commit
d1fc0591a5
@ -68,6 +68,11 @@
|
|||||||
'-O3'
|
'-O3'
|
||||||
],
|
],
|
||||||
'MACOSX_DEPLOYMENT_TARGET': '10.7'
|
'MACOSX_DEPLOYMENT_TARGET': '10.7'
|
||||||
|
},
|
||||||
|
'msvs_settings': {
|
||||||
|
'VCCLCompilerTool': {
|
||||||
|
'ExceptionHandling': 1 # /EHsc
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
|
@ -283,19 +283,19 @@ class ResizeWorker : public NanAsyncWorker {
|
|||||||
break;
|
break;
|
||||||
case Canvas::MAX:
|
case Canvas::MAX:
|
||||||
if (xfactor > yfactor) {
|
if (xfactor > yfactor) {
|
||||||
baton->height = round(static_cast<double>(inputHeight) / xfactor);
|
baton->height = static_cast<int>(round(static_cast<double>(inputHeight) / xfactor));
|
||||||
yfactor = xfactor;
|
yfactor = xfactor;
|
||||||
} else {
|
} else {
|
||||||
baton->width = round(static_cast<double>(inputWidth) / yfactor);
|
baton->width = static_cast<int>(round(static_cast<double>(inputWidth) / yfactor));
|
||||||
xfactor = yfactor;
|
xfactor = yfactor;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Canvas::MIN:
|
case Canvas::MIN:
|
||||||
if (xfactor < yfactor) {
|
if (xfactor < yfactor) {
|
||||||
baton->height = round(static_cast<double>(inputHeight) / xfactor);
|
baton->height = static_cast<int>(round(static_cast<double>(inputHeight) / xfactor));
|
||||||
yfactor = xfactor;
|
yfactor = xfactor;
|
||||||
} else {
|
} else {
|
||||||
baton->width = round(static_cast<double>(inputWidth) / yfactor);
|
baton->width = static_cast<int>(round(static_cast<double>(inputWidth) / yfactor));
|
||||||
xfactor = yfactor;
|
xfactor = yfactor;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -311,7 +311,7 @@ class ResizeWorker : public NanAsyncWorker {
|
|||||||
} else {
|
} else {
|
||||||
// Auto height
|
// Auto height
|
||||||
yfactor = xfactor;
|
yfactor = xfactor;
|
||||||
baton->height = floor(static_cast<double>(inputHeight) / yfactor);
|
baton->height = static_cast<int>(floor(static_cast<double>(inputHeight) / yfactor));
|
||||||
}
|
}
|
||||||
} else if (baton->height > 0) {
|
} else if (baton->height > 0) {
|
||||||
// Fixed height
|
// Fixed height
|
||||||
@ -321,7 +321,7 @@ class ResizeWorker : public NanAsyncWorker {
|
|||||||
} else {
|
} else {
|
||||||
// Auto width
|
// Auto width
|
||||||
xfactor = yfactor;
|
xfactor = yfactor;
|
||||||
baton->width = floor(static_cast<double>(inputWidth) / xfactor);
|
baton->width = static_cast<int>(floor(static_cast<double>(inputWidth) / xfactor));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Identity transform
|
// Identity transform
|
||||||
@ -1086,9 +1086,9 @@ class ResizeWorker : public NanAsyncWorker {
|
|||||||
int shrink = 1;
|
int shrink = 1;
|
||||||
if (factor >= 2 && interpolatorWindowSize > 3) {
|
if (factor >= 2 && interpolatorWindowSize > 3) {
|
||||||
// Shrink less, affine more with interpolators that use at least 4x4 pixel window, e.g. bicubic
|
// Shrink less, affine more with interpolators that use at least 4x4 pixel window, e.g. bicubic
|
||||||
shrink = floor(factor * 3.0 / interpolatorWindowSize);
|
shrink = static_cast<int>(floor(factor * 3.0 / interpolatorWindowSize));
|
||||||
} else {
|
} else {
|
||||||
shrink = floor(factor);
|
shrink = static_cast<int>(floor(factor));
|
||||||
}
|
}
|
||||||
if (shrink < 1) {
|
if (shrink < 1) {
|
||||||
shrink = 1;
|
shrink = 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user