From 22a59ac839d16c370c542136dfacb197159b22cc Mon Sep 17 00:00:00 2001 From: Metallicow Date: Sat, 27 Jan 2018 00:02:56 -0600 Subject: [PATCH] Trim trailing whitespace src dir --- src/PIL/DcxImagePlugin.py | 2 +- src/PIL/Image.py | 2 +- src/PIL/ImageTk.py | 2 +- src/PIL/MpoImagePlugin.py | 2 +- src/PIL/PngImagePlugin.py | 2 +- src/PIL/TiffTags.py | 6 +++--- src/_imaging.c | 20 ++++++++++---------- src/_imagingft.c | 8 ++++---- src/libImaging/Resample.c | 2 +- src/libImaging/SgiRleDecode.c | 20 ++++++++++---------- src/libImaging/Unpack.c | 4 ++-- 11 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/PIL/DcxImagePlugin.py b/src/PIL/DcxImagePlugin.py index 0d920ad3c..204592759 100644 --- a/src/PIL/DcxImagePlugin.py +++ b/src/PIL/DcxImagePlugin.py @@ -42,7 +42,7 @@ class DcxImageFile(PcxImageFile): format = "DCX" format_description = "Intel DCX" _close_exclusive_fp_after_loading = False - + def _open(self): # Header diff --git a/src/PIL/Image.py b/src/PIL/Image.py index 8d4d9c8a8..a5bb5a00d 100644 --- a/src/PIL/Image.py +++ b/src/PIL/Image.py @@ -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') diff --git a/src/PIL/ImageTk.py b/src/PIL/ImageTk.py index a19ed1d0d..78ba6d1cb 100644 --- a/src/PIL/ImageTk.py +++ b/src/PIL/ImageTk.py @@ -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) diff --git a/src/PIL/MpoImagePlugin.py b/src/PIL/MpoImagePlugin.py index 8ad27b919..460ccec27 100644 --- a/src/PIL/MpoImagePlugin.py +++ b/src/PIL/MpoImagePlugin.py @@ -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) diff --git a/src/PIL/PngImagePlugin.py b/src/PIL/PngImagePlugin.py index fd89213ed..4b9f5da5e 100644 --- a/src/PIL/PngImagePlugin.py +++ b/src/PIL/PngImagePlugin.py @@ -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") diff --git a/src/PIL/TiffTags.py b/src/PIL/TiffTags.py index eba88ef8d..d3150775c 100644 --- a/src/PIL/TiffTags.py +++ b/src/PIL/TiffTags.py @@ -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 } diff --git a/src/_imaging.c b/src/_imaging.c index e50a06e84..11f5f6ea4 100644 --- a/src/_imaging.c +++ b/src/_imaging.c @@ -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); diff --git a/src/_imagingft.c b/src/_imagingft.c index 92642e733..86e0fe45b 100644 --- a/src/_imagingft.c +++ b/src/_imagingft.c @@ -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 */ diff --git a/src/libImaging/Resample.c b/src/libImaging/Resample.c index 877f25a94..7cefdb2af 100644 --- a/src/libImaging/Resample.c +++ b/src/libImaging/Resample.c @@ -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) { diff --git a/src/libImaging/SgiRleDecode.c b/src/libImaging/SgiRleDecode.c index 1d41437fc..9d8e56376 100644 --- a/src/libImaging/SgiRleDecode.c +++ b/src/libImaging/SgiRleDecode.c @@ -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); diff --git a/src/libImaging/Unpack.c b/src/libImaging/Unpack.c index 036cec5e4..0e7462c6e 100644 --- a/src/libImaging/Unpack.c +++ b/src/libImaging/Unpack.c @@ -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},