mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-05 06:00:58 +03:00
Crop if box size matches requested size
This commit is contained in:
parent
e9424b1997
commit
81c72bd297
|
@ -1529,8 +1529,10 @@ _resize(ImagingObject* self, PyObject* args)
|
||||||
return ImagingError_ValueError("box can't be empty");
|
return ImagingError_ValueError("box can't be empty");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (box[0] == 0 && box[1] == 0 && box[2] == xsize && box[3] == ysize) {
|
// If box's coordinates are int and box size matches requested size
|
||||||
imOut = ImagingCopy(imIn);
|
if (box[0] - (int) box[0] == 0 && box[1] - (int) box[1] == 0
|
||||||
|
&& box[2] - box[0] == xsize && box[3] - box[1] == ysize) {
|
||||||
|
imOut = ImagingCrop(imIn, box[0], box[1], box[2], box[3]);
|
||||||
}
|
}
|
||||||
else if (filter == IMAGING_TRANSFORM_NEAREST) {
|
else if (filter == IMAGING_TRANSFORM_NEAREST) {
|
||||||
double a[6];
|
double a[6];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user