make im.stretch strong alias to im.resize.

mark im.stretch as deprecated.
This commit is contained in:
homm 2014-11-19 03:26:17 +03:00
parent 6078e6e1a7
commit 41029f0149

View File

@ -1626,25 +1626,6 @@ im_setmode(ImagingObject* self, PyObject* args)
return Py_None;
}
static PyObject*
_stretch(ImagingObject* self, PyObject* args)
{
Imaging imIn, imOut;
int xsize, ysize;
int filter = IMAGING_TRANSFORM_NEAREST;
if (!PyArg_ParseTuple(args, "(ii)|i", &xsize, &ysize, &filter))
return NULL;
imIn = self->image;
imOut = ImagingStretch(imIn, xsize, ysize, filter);
if ( ! imOut) {
return NULL;
}
return PyImagingNew(imOut);
}
static PyObject*
_transform2(ImagingObject* self, PyObject* args)
@ -3026,8 +3007,10 @@ static struct PyMethodDef methods[] = {
{"rankfilter", (PyCFunction)_rankfilter, 1},
#endif
{"resize", (PyCFunction)_resize, 1},
// There was two methods for image resize before.
// Starting from 2.7 stretch is obsolete.
{"stretch", (PyCFunction)_resize, 1},
{"rotate", (PyCFunction)_rotate, 1},
{"stretch", (PyCFunction)_stretch, 1},
{"transpose", (PyCFunction)_transpose, 1},
{"transform2", (PyCFunction)_transform2, 1},