Trim trailing whitespace src dir

This commit is contained in:
Metallicow 2018-01-27 00:02:56 -06:00
parent c255948860
commit 22a59ac839
11 changed files with 35 additions and 35 deletions

View File

@ -42,7 +42,7 @@ class DcxImageFile(PcxImageFile):
format = "DCX"
format_description = "Intel DCX"
_close_exclusive_fp_after_loading = False
def _open(self):
# Header

View File

@ -2102,7 +2102,7 @@ class Image(object):
in the output image.
:returns: An :py:class:`~PIL.Image.Image` object.
"""
if self.mode == 'LA':
return self.convert('La').transform(
size, method, data, resample, fill).convert('LA')

View File

@ -278,7 +278,7 @@ class BitmapImage(object):
def getimage(photo):
""" This function is unimplemented """
"""Copies the contents of a PhotoImage to a PIL image memory."""
photo.tk.call("PyImagingPhotoGet", photo)

View File

@ -40,7 +40,7 @@ class MpoImageFile(JpegImagePlugin.JpegImageFile):
format = "MPO"
format_description = "MPO (CIPA DC-007)"
_close_exclusive_fp_after_loading = False
def _open(self):
self.fp.seek(0) # prep the fp in order to pass the JPEG test
JpegImagePlugin.JpegImageFile._open(self)

View File

@ -750,7 +750,7 @@ def _save(im, fp, filename, chunk=putchunk):
name = b"ICC Profile"
data = name + b"\0\0" + zlib.compress(icc)
chunk(fp, b"iCCP", data)
# You must either have sRGB or iCCP.
# Disallow sRGB chunks when an iCCP-chunk has been emitted.
chunks.remove(b"sRGB")

View File

@ -143,7 +143,7 @@ TAGS_V2 = {
342: ("TransferRange", SHORT, 6),
347: ("JPEGTables", UNDEFINED, 1),
# obsolete JPEG tags
512: ("JPEGProc", SHORT, 1),
513: ("JPEGInterchangeFormat", LONG, 1),
@ -161,7 +161,7 @@ TAGS_V2 = {
532: ("ReferenceBlackWhite", LONG, 0),
700: ('XMP', BYTE, 1),
33432: ("Copyright", ASCII, 1),
34377: ('PhotoshopInfo', BYTE, 1),
@ -193,7 +193,7 @@ TAGS_V2 = {
50741: ("MakerNoteSafety", SHORT, 1, {"Unsafe": 0, "Safe": 1}),
50780: ("BestQualityScale", RATIONAL, 1),
50838: ("ImageJMetaDataByteCounts", LONG, 0), # Can be more than one
50838: ("ImageJMetaDataByteCounts", LONG, 0), # Can be more than one
50839: ("ImageJMetaData", UNDEFINED, 1) # see Issue #2006
}

View File

@ -1499,11 +1499,11 @@ _resize(ImagingObject* self, PyObject* args)
int xsize, ysize;
int filter = IMAGING_TRANSFORM_NEAREST;
float box[4] = {0, 0, 0, 0};
imIn = self->image;
box[2] = imIn->xsize;
box[3] = imIn->ysize;
if (!PyArg_ParseTuple(args, "(ii)|i(ffff)", &xsize, &ysize, &filter,
&box[0], &box[1], &box[2], &box[3]))
return NULL;
@ -3325,7 +3325,7 @@ _reset_stats(PyObject* self, PyObject* args)
if (!PyArg_ParseTuple(args, ":reset_stats"))
return NULL;
arena->stats_new_count = 0;
arena->stats_allocated_blocks = 0;
arena->stats_reused_blocks = 0;
@ -3341,7 +3341,7 @@ _get_alignment(PyObject* self, PyObject* args)
{
if (!PyArg_ParseTuple(args, ":get_alignment"))
return NULL;
return PyInt_FromLong(ImagingDefaultArena.alignment);
}
@ -3350,7 +3350,7 @@ _get_block_size(PyObject* self, PyObject* args)
{
if (!PyArg_ParseTuple(args, ":get_block_size"))
return NULL;
return PyInt_FromLong(ImagingDefaultArena.block_size);
}
@ -3359,7 +3359,7 @@ _get_blocks_max(PyObject* self, PyObject* args)
{
if (!PyArg_ParseTuple(args, ":get_blocks_max"))
return NULL;
return PyInt_FromLong(ImagingDefaultArena.blocks_max);
}
@ -3369,7 +3369,7 @@ _set_alignment(PyObject* self, PyObject* args)
int alignment;
if (!PyArg_ParseTuple(args, "i:set_alignment", &alignment))
return NULL;
if (alignment < 1 || alignment > 128) {
PyErr_SetString(PyExc_ValueError, "alignment should be from 1 to 128");
return NULL;
@ -3392,7 +3392,7 @@ _set_block_size(PyObject* self, PyObject* args)
int block_size;
if (!PyArg_ParseTuple(args, "i:set_block_size", &block_size))
return NULL;
if (block_size <= 0) {
PyErr_SetString(PyExc_ValueError,
"block_size should be greater than 0");
@ -3417,7 +3417,7 @@ _set_blocks_max(PyObject* self, PyObject* args)
int blocks_max;
if (!PyArg_ParseTuple(args, "i:set_blocks_max", &blocks_max))
return NULL;
if (blocks_max < 0) {
PyErr_SetString(PyExc_ValueError,
"blocks_max should be greater than 0");
@ -3440,7 +3440,7 @@ _clear_cache(PyObject* self, PyObject* args)
if (!PyArg_ParseTuple(args, "|i:clear_cache", &i))
return NULL;
ImagingMemoryClearCache(&ImagingDefaultArena, i);
Py_INCREF(Py_None);

View File

@ -108,7 +108,7 @@ typedef struct {
t_raqm_set_par_direction set_par_direction;
t_raqm_add_font_feature add_font_feature;
t_raqm_set_freetype_face set_freetype_face;
t_raqm_layout layout;
t_raqm_layout layout;
t_raqm_get_glyphs get_glyphs;
t_raqm_get_glyphs_01 get_glyphs_01;
t_raqm_destroy destroy;
@ -247,7 +247,7 @@ getfont(PyObject* self_, PyObject* args, PyObject* kw)
return NULL;
}
if (!PyArg_ParseTupleAndKeywords(args, kw, "eti|is"PY_ARG_BYTES_LENGTH"i",
if (!PyArg_ParseTupleAndKeywords(args, kw, "eti|is"PY_ARG_BYTES_LENGTH"i",
kwlist,
Py_FileSystemDefaultEncoding, &filename,
&size, &index, &encoding, &font_bytes,
@ -458,7 +458,7 @@ text_layout_raqm(PyObject* string, FontObject* self, const char* dir,
count = 0;
goto failed;
}
} else { /* version == 2 */
} else { /* version == 2 */
glyphs = (*p_raqm.get_glyphs)(rq, &count);
if (glyphs == NULL) {
PyErr_SetString(PyExc_ValueError, "raqm_get_glyphs() failed.");
@ -654,7 +654,7 @@ font_getsize(FontObject* self, PyObject* args)
PyMem_Free(glyph_info);
glyph_info = NULL;
}
if (face) {
/* left bearing */

View File

@ -226,7 +226,7 @@ normalize_coeffs_8bpc(int outSize, int ksize, double *prekk)
void
void
ImagingResampleHorizontal_8bpc(Imaging imOut, Imaging imIn, int offset,
int ksize, int *bounds, double *prekk)
{

View File

@ -28,7 +28,7 @@ static void read4B(UINT32* dest, UINT8* buf)
static int expandrow(UINT8* dest, UINT8* src, int n, int z)
{
UINT8 pixel, count;
for (;n > 0; n--)
{
pixel = *src++;
@ -42,7 +42,7 @@ static int expandrow(UINT8* dest, UINT8* src, int n, int z)
*dest = *src++;
dest += z;
}
}
else {
pixel = *src++;
@ -51,7 +51,7 @@ static int expandrow(UINT8* dest, UINT8* src, int n, int z)
dest += z;
}
}
}
return 0;
}
@ -60,7 +60,7 @@ static int expandrow2(UINT16* dest, UINT16* src, int n, int z)
{
UINT8 pixel, count;
for (;n > 0; n--)
{
pixel = ((UINT8*)src)[1];
@ -96,7 +96,7 @@ ImagingSgiRleDecode(Imaging im, ImagingCodecState state,
SGISTATE *c;
int err = 0;
/* Get all data from File descriptor */
/* Get all data from File descriptor */
c = (SGISTATE*)state->context;
_imaging_seek_pyFd(state->fd, 0L, SEEK_END);
c->bufsize = _imaging_tell_pyFd(state->fd);
@ -155,7 +155,7 @@ ImagingSgiRleDecode(Imaging im, ImagingCodecState state,
c->rleoffset = c->starttab[c->rowno + c->channo * im->ysize];
c->rlelength = c->lengthtab[c->rowno + c->channo * im->ysize];
c->rleoffset -= SGI_HEADER_SIZE;
/* row decompression */
if (c->bpc ==1) {
if(expandrow(&state->buffer[c->channo], &ptr[c->rleoffset], c->rlelength, im->bands))
@ -165,19 +165,19 @@ ImagingSgiRleDecode(Imaging im, ImagingCodecState state,
if(expandrow2((UINT16*)&state->buffer[c->channo * 2], (UINT16*)&ptr[c->rleoffset], c->rlelength, im->bands))
goto sgi_finish_decode;
}
state->count += c->rlelength;
}
/* store decompressed data in image */
state->shuffle((UINT8*)im->image[state->y], state->buffer, im->xsize);
}
c->bufsize++;
sgi_finish_decode: ;
free(c->starttab);
free(c->lengthtab);
free(ptr);

View File

@ -188,7 +188,7 @@ unpack1IR(UINT8* out, const UINT8* in, int pixels)
static void
unpack18(UINT8* out, const UINT8* in, int pixels)
{
/* Unpack a '|b1' image, which is a numpy boolean.
/* Unpack a '|b1' image, which is a numpy boolean.
1 == true, 0==false, in bytes */
int i;
@ -1334,7 +1334,7 @@ static struct {
{"RGBA", "RGBA;16N", 64, unpackRGBA16L},
{"RGBX", "RGBX;16N", 64, unpackRGBA16B},
#endif
/* true colour w. alpha premultiplied */
{"RGBa", "RGBa", 32, copy4},