mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-26 17:24:31 +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");
|
||||
}
|
||||
|
||||
if (box[0] == 0 && box[1] == 0 && box[2] == xsize && box[3] == ysize) {
|
||||
imOut = ImagingCopy(imIn);
|
||||
// If box's coordinates are int and box size matches requested size
|
||||
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) {
|
||||
double a[6];
|
||||
|
|
Loading…
Reference in New Issue
Block a user