From 572a3d970ca7b6974eed777fd6ee2443fa14363a Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sat, 3 Sep 2016 12:23:42 +1000 Subject: [PATCH] Removed whitespace from blank lines --- CHANGES.rst | 118 ++++++++++++++++----------------- PIL/Jpeg2KImagePlugin.py | 4 +- Tests/README.rst | 2 +- Tests/test_file_tiff.py | 6 +- Tests/test_imageops.py | 2 +- _imagingft.c | 8 +-- _imagingmorph.c | 4 +- depends/README.rst | 2 +- depends/alpine_Dockerfile | 2 +- docs/installation.rst | 2 +- docs/reference/PixelAccess.rst | 12 ++-- docs/reference/PyAccess.rst | 4 +- docs/reference/TiffTags.rst | 2 +- encode.c | 4 +- libImaging/Convert.c | 20 +++--- libImaging/Geometry.c | 6 +- libImaging/Jpeg2K.h | 2 +- libImaging/Jpeg2KDecode.c | 40 +++++------ libImaging/Jpeg2KEncode.c | 6 +- libImaging/Pack.c | 2 +- libImaging/Quant.c | 4 +- libImaging/QuantHeap.c | 2 +- libImaging/RankFilter.c | 2 +- libImaging/Unpack.c | 6 +- libImaging/ZipEncode.c | 2 +- libImaging/codec_fd.c | 14 ++-- winbuild/build.py | 2 +- 27 files changed, 140 insertions(+), 140 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index fd5fa7bc2..25f3d9859 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -18,7 +18,7 @@ Changelog (Pillow) - Skip failing numpy tests on Pypy <= 5.3.1 #2090 [arjennienhuis] - + - Show warning when trying to save RGBA image as JPEG #2010 [homm] @@ -33,16 +33,16 @@ Changelog (Pillow) - Add ImageOps.scale to expand or contract a PIL image by a factor #2011 [vlmath] - + - Flake8 fixes #2050 [hugovk] - Updated freetype to 2.6.5 on Appveyor builds #2035 [radarhere] - + - PCX encoder fixes #2023, pr #2041 [homm] - + - Docs: Windows console prompts are > #2031 [techtonik] @@ -72,7 +72,7 @@ Changelog (Pillow) - Fix issue converting P mode to LA #1986 [didrix] - + - Moved test_j2k_overflow to check_j2k_overflow, prevent DOS of our 32bit testing machines #1995 [wiredfool] @@ -99,10 +99,10 @@ Changelog (Pillow) - test_imagecms: Reduce precision of extended info due to 32 bit machine precision #1990 [AbdealiJK] - + - Binary Tiff Metadata/ICC profile. #1988 [wiredfool] - + - Ignore large text blocks in PNG if LOAD_TRUNCATED_IMAGES is enabled #1970 [homm] @@ -111,7 +111,7 @@ Changelog (Pillow) - Skip extra 0xff00 in jpeg #1977 [kkopachev] - + - Use bytearray for palette mutable storage #1985 [radarhere, wiredfool] @@ -123,7 +123,7 @@ Changelog (Pillow) - Changed depends/install_*.sh urls to point to github pillow-depends repo #1983 [wiredfool] - + - Allow ICC profile from `encoderinfo` while saving PNGs #1909 [homm] @@ -138,7 +138,7 @@ Changelog (Pillow) - Change equals method on Image so it short circuits #1967 [mattBoros] - + - Runtime loading of TCL/TK libraries, eliminating build time dependency. #1932 [matthew-brett] @@ -300,7 +300,7 @@ Changelog (Pillow) - Added install docs for Fedora 23 and FreeBSD #1729, #1739, #1792 [koobs, zandermartin, wiredfool] - + - Fixed TIFF multiframe load when the frames have different compression types #1782 [radarhere, geka000] @@ -309,7 +309,7 @@ Changelog (Pillow) - Updated dates in PIL license in OleFileIO README #1787 [radarhere] - + - Corrected Tiff tag names #1786 [radarhere] @@ -360,7 +360,7 @@ Changelog (Pillow) - Add a loader for the FTEX format from Independence War 2: Edge of Chaos #1688 [jleclanche] - + - Improved alpha_composite documentation #1698 [radarhere] @@ -378,7 +378,7 @@ Changelog (Pillow) - Fixed support for .gbr version 1 images, added support for version 2 in GbrImagePlugin #1653 [wiredfool] - + - Clarified which YCbCr format is used #1677 [radarhere] @@ -455,7 +455,7 @@ Changelog (Pillow) - Updated installation docs for new versions of dependencies #1611 [radarhere] - + - Removed unrunnable test file #1610 [radarhere] @@ -464,7 +464,7 @@ Changelog (Pillow) - Added field type constants to TiffTags #1596 [radarhere] - + - Allow saving RowsPerStrip with libtiff #1594 [wiredfool] @@ -473,10 +473,10 @@ Changelog (Pillow) - Changed some urls in the docs to use https #1580 [hugovk] - + - Removed logger.exception from ImageFile.py #1590 [radarhere] - + - Removed warnings module check #1587 [radarhere] @@ -491,7 +491,7 @@ Changelog (Pillow) - Consistent multiline text spacing #1574 [wiredfool, hugovk] - + - Removed unused lines in BDFFontFile #1530 [radarhere] @@ -509,19 +509,19 @@ Changelog (Pillow) - Docs and code health fixes #1565 #1566 #1581 #1586 #1591 #1621 [radarhere] - + - Updated freetype to 2.6.2 #1564 [radarhere] - Updated WebP to 0.5.0 for Travis #1515 #1609 [radarhere] - + - Fix missing 'version' key value in __array_interface__ #1519 [mattip] - + - Replaced os.popen with subprocess.Popen to pilprint script #1523 [radarhere] - + - Catch OverflowError in SpiderImagePlugin #1545 [radarhere, MrShark] @@ -533,7 +533,7 @@ Changelog (Pillow) - Fix Exception when requiring jpeg #1501 [hansmosh] - + - Dependency scripts for Debian and Ubuntu #1486 [wiredfool] @@ -566,28 +566,28 @@ Changelog (Pillow) - Added PDF multipage saving #1445 [radarhere] - + - Removed deprecated code, Image.tostring, Image.fromstring, Image.offset, ImageDraw.setink, ImageDraw.setfill, ImageFileIO, ImageFont.FreeTypeFont and ImageFont.truetype `file` kwarg, ImagePalette private _make functions, ImageWin.fromstring and ImageWin.tostring #1343 [radarhere] - Load more broken images #1428 [homm] - + - Require zlib and libjpeg #1439 [wiredfool] - Preserve alpha when converting from a QImage to a Pillow Image by using png instead of ppm #1429 [ericfrederich] - + - Qt needs 32 bit aligned image data #1430 [ericfrederich] - + - Tiff ImageFileDirectory rewrite #1419 [anntzer, wiredfool, homm] - Removed spammy debug logging #1423 [wiredfool] - + - Save as GiF89a with support for animation parameters #1384 [radarhere] @@ -608,19 +608,19 @@ Changelog (Pillow) - Single threaded build for pypy3, refactor #1413 [wiredfool] - + - Fix loading of truncated images with LOAD_TRUNCATED_IMAGES enabled #1366 [homm] - Documentation update for concepts: bands [merriam] - + - Add Solaris/SmartOS include and library directories #1356 [njones11] - + - Improved handling of getink color #1387 [radarhere] - + - Disable compiler optimizations for topalette and tobilevel functions for all msvc versions, fixes #1357 [cgohlke] @@ -656,10 +656,10 @@ Changelog (Pillow) - Fix fast rotate operations #1373 [radarhere] - + - Added support for pathlib Path objects to open and save #1372 [radarhere] - + - Changed register calls to use format property #1333 [radarhere] @@ -677,7 +677,7 @@ Changelog (Pillow) - Added various tests #1330, #1344 [radarhere] - + - More ImageFont tests #1327 [hugovk] @@ -704,10 +704,10 @@ Changelog (Pillow) - Added width and height properties #1304 [radarhere] - + - Update tiff and tk tcl 8.5 versions #1303 [radarhere, wiredfool] - + - Add functions to convert: Image <-> QImage; Image <-> QPixmap #1217 [radarhere, rominf] @@ -716,19 +716,19 @@ Changelog (Pillow) - Multiline text in ImageDraw #1177 [allo-, radarhere] - + - Automated Windows CI/build support #1278 [wiredfool] - Removed support for Tk versions earlier than 8.4 #1288 [radarhere] - + - Fixed polygon edge drawing #1255 (fixes #1252) [radarhere] - + - Check prefix length in _accept methods #1267 [radarhere] - + - Register MIME type for BMP #1277 [coldmind] @@ -737,7 +737,7 @@ Changelog (Pillow) - Identify XBM file created with filename including underscore #1230 (fixes #1229) [hugovk] - + - Copy image when saving in GifImagePlugin #1231 (fixes #718) [radarhere] @@ -761,7 +761,7 @@ Changelog (Pillow) - Setting transparency value to 0 when the tRNS contains only null byte(s) #1239 [juztin] - + - Separated out feature checking from selftest #1233 [radarhere] @@ -830,7 +830,7 @@ Changelog (Pillow) - Fix ImagingEffectNoise #1128 [hugovk] - + - Remove unreachable code [hugovk] @@ -842,13 +842,13 @@ Changelog (Pillow) - Fast path for opaque pixels in RGBa unpacker #1088 [bgilbert] - + - Enable basic support for 'RGBa' raw encoding/decoding #1096 [immerrr] - Fix pickling L mode images with no palette, #1095 [hugovk] - + - iPython display hook #1091 [wiredfool] @@ -872,13 +872,13 @@ Changelog (Pillow) - Use underscores, not spaces, in TIFF tag kwargs. #1044, #1058 [anntzer, hugovk] - + - Update PSDraw for Python3, add tests. #1055 [hugovk] - Use Bicubic filtering by default for thumbnails. Don't use Jpeg Draft mode for thumbnails. #1029 [homm] - + - Fix MSVC compiler error: Use Py_ssize_t instead of ssize_t #1051 [cgohlke] @@ -902,7 +902,7 @@ Changelog (Pillow) - Fix for saving TIFF image into an io.BytesIO buffer #1011 [mfergie] - + - Fix antialias compilation on debug versions of Python #1010 [wiredfool] @@ -914,7 +914,7 @@ Changelog (Pillow) - Use PyQt4 if it has already been imported, otherwise prefer PyQt5. #1003 [AurelienBallier] - + - Speedup resample implementation up to 2.5 times. #977 [homm] @@ -935,7 +935,7 @@ Changelog (Pillow) - Webp Metadata Skip Test comments #954 [wiredfool] - + - Fixes for things rpmlint complains about #942 [manisandro] @@ -953,7 +953,7 @@ Changelog (Pillow) - Fix SciPy regression in Image.resize #945 [wiredfool] - + - Fix manifest to include all test files. [aclark4life] @@ -971,13 +971,13 @@ Changelog (Pillow) - Use redistributable ICC profiles for testing, skip if not available #923 [wiredfool] - + - Additional documentation for JPEG info and save options #890 [wiredfool] - Fix JPEG Encoding memory leak when exif or qtables were specified [wiredfool] - + - Image.tobytes() and Image.tostring() documentation update #916 #917 [mgedmin] @@ -1043,7 +1043,7 @@ Changelog (Pillow) - Added support for reading MPO files [Feneric] - + - Added support for encoding and decoding iTXt chunks #818 [dolda2000] @@ -1093,7 +1093,7 @@ Changelog (Pillow) - Fixed CVE-2014-3589, a DOS in the IcnsImagePlugin (backport) [Andrew Drake] - + 2.5.1 (2014-07-10) ------------------ @@ -1114,10 +1114,10 @@ Changelog (Pillow) - Prevent shell injection #748 [mbrown1413, wiredfool] - + - Support for Resolution in BMP files #734 [gcq] - + - Fix error in setup.py for Python 3 [matthew-brett] diff --git a/PIL/Jpeg2KImagePlugin.py b/PIL/Jpeg2KImagePlugin.py index d54ee0ca4..66de34bfa 100644 --- a/PIL/Jpeg2KImagePlugin.py +++ b/PIL/Jpeg2KImagePlugin.py @@ -85,7 +85,7 @@ def _parse_jp2_header(fp): mode = None bpc = None nc = None - + hio = io.BytesIO(header) while True: lbox, tbox = struct.unpack('>I4s', hio.read(8)) @@ -144,7 +144,7 @@ def _parse_jp2_header(fp): if size is None or mode is None: raise SyntaxError("Malformed jp2 header") - + return (size, mode) ## diff --git a/Tests/README.rst b/Tests/README.rst index e3f160b09..a7212cb3d 100644 --- a/Tests/README.rst +++ b/Tests/README.rst @@ -11,7 +11,7 @@ Install:: pip install coverage nose If you're using Python 2.6, there's one additional dependency:: - + pip install unittest2 Execution diff --git a/Tests/test_file_tiff.py b/Tests/test_file_tiff.py index f42a157fd..9858ce5a0 100644 --- a/Tests/test_file_tiff.py +++ b/Tests/test_file_tiff.py @@ -472,11 +472,11 @@ class TestFileTiff(PillowTestCase): tmpfile = self.tempfile("temp.tif") im.save(tmpfile) - + reloaded = Image.open(tmpfile) - + self.assert_image_equal(im, reloaded) - + if __name__ == '__main__': unittest.main() diff --git a/Tests/test_imageops.py b/Tests/test_imageops.py index 3675e7b71..11cf3619d 100644 --- a/Tests/test_imageops.py +++ b/Tests/test_imageops.py @@ -81,7 +81,7 @@ class TestImageOps(PillowTestCase): def test_scale(self): # Test the scaling function i = hopper("L").resize((50, 50)) - + with self.assertRaises(ValueError): ImageOps.scale(i, -1) diff --git a/_imagingft.c b/_imagingft.c index d2ff66e25..ae62fc74e 100644 --- a/_imagingft.c +++ b/_imagingft.c @@ -119,9 +119,9 @@ getfont(PyObject* self_, PyObject* args, PyObject* kw) PyMem_Free(filename); return NULL; } - + self->face = NULL; - + if (filename && font_bytes_size <= 0) { self->font_bytes = NULL; error = FT_New_Face(library, filename, index, &self->face); @@ -246,11 +246,11 @@ font_getsize(FontObject* self, PyObject* args) y_max = bbox.yMax; if (bbox.yMin < y_min) y_min = bbox.yMin; - + /* find max distance of baseline from top */ if (face->glyph->metrics.horiBearingY > yoffset) yoffset = face->glyph->metrics.horiBearingY; - + last_index = index; FT_Done_Glyph(glyph); } diff --git a/_imagingmorph.c b/_imagingmorph.c index 70779d036..2b5e7bc5d 100644 --- a/_imagingmorph.c +++ b/_imagingmorph.c @@ -231,7 +231,7 @@ get_on_pixels(PyObject *self, PyObject* args) int row_idx, col_idx; int width, height; PyObject *ret = PyList_New(0); - + if (!PyArg_ParseTuple(args, "n", &i0)) { PyErr_SetString(PyExc_RuntimeError, "Argument parsing problem"); @@ -241,7 +241,7 @@ get_on_pixels(PyObject *self, PyObject* args) rows = img->image8; width = img->xsize; height = img->ysize; - + for (row_idx=0; row_idx < height; row_idx++) { UINT8 *row = rows[row_idx]; for (col_idx=0; col_idxencode(encoder->im, &encoder->state, (UINT8*) NULL, 0); - + result = Py_BuildValue("ii", status, encoder->state.errcode); return result; @@ -291,7 +291,7 @@ _setfd(ImagingEncoderObject* encoder, PyObject* args) Py_XINCREF(fd); state->fd = fd; - + Py_INCREF(Py_None); return Py_None; } diff --git a/libImaging/Convert.c b/libImaging/Convert.c index 9c562d4be..0ec5ef864 100644 --- a/libImaging/Convert.c +++ b/libImaging/Convert.c @@ -294,7 +294,7 @@ rgb2hsv(UINT8* out, const UINT8* in, int xsize) r = in[0]; g = in[1]; b = in[2]; - + maxc = MAX(r,MAX(g,b)); minc = MIN(r,MIN(g,b)); uv = maxc; @@ -324,7 +324,7 @@ rgb2hsv(UINT8* out, const UINT8* in, int xsize) *out++ = uh; *out++ = us; *out++ = uv; - + } *out++ = in[3]; } @@ -333,18 +333,18 @@ rgb2hsv(UINT8* out, const UINT8* in, int xsize) static void hsv2rgb(UINT8* out, const UINT8* in, int xsize) { // following colorsys.py - + int p,q,t; UINT8 up,uq,ut; int i, x; float f, fs; UINT8 h,s,v; - + for (x = 0; x < xsize; x++, in += 4) { h = in[0]; s = in[1]; v = in[2]; - + if (s==0){ *out++ = v; *out++ = v; @@ -360,7 +360,7 @@ hsv2rgb(UINT8* out, const UINT8* in, int xsize) up = (UINT8)CLIP(p); uq = (UINT8)CLIP(q); ut = (UINT8)CLIP(t); - + switch (i%6) { case 0: *out++ = v; @@ -392,7 +392,7 @@ hsv2rgb(UINT8* out, const UINT8* in, int xsize) *out++ = up; *out++ = uq; break; - + } } *out++ = in[3]; @@ -481,7 +481,7 @@ rgba2rgbA(UINT8* out, const UINT8* in, int xsize) * where any pixel that matches the color will have the * alpha channel set to 0 */ - + static void rgbT2rgba(UINT8* out, int xsize, int r, int g, int b) { @@ -502,7 +502,7 @@ rgbT2rgba(UINT8* out, int xsize, int r, int g, int b) } } } - + /* ---------------- */ /* CMYK conversions */ @@ -1383,7 +1383,7 @@ ImagingConvertTransparent(Imaging imIn, const char *mode, if (!imIn){ return (Imaging) ImagingError_ModeError(); } - + if (!((strcmp(imIn->mode, "RGB") == 0 || strcmp(imIn->mode, "L") == 0) && strcmp(mode, "RGBA") == 0)) diff --git a/libImaging/Geometry.c b/libImaging/Geometry.c index f775e3323..90cd57d2e 100644 --- a/libImaging/Geometry.c +++ b/libImaging/Geometry.c @@ -142,7 +142,7 @@ ImagingTranspose(Imaging imOut, Imaging imIn) } ImagingSectionEnter(&cookie); - + if (imIn->image8) TRANSPOSE(image8) else @@ -692,7 +692,7 @@ ImagingScaleAffine(Imaging imOut, Imaging imIn, x1 = imOut->xsize; if (y1 > imOut->ysize) y1 = imOut->ysize; - + /* malloc check ok, uses calloc for overflow */ xintab = (int*) calloc(imOut->xsize, sizeof(int)); if (!xintab) { @@ -873,7 +873,7 @@ ImagingTransformAffine(Imaging imOut, Imaging imIn, /* FIXME: cannot really think of any reasonable case when the following code is used. maybe we should fall back on the slow generic transform engine in this case? */ - + ImagingCopyInfo(imOut, imIn); xsize = (int) imIn->xsize; diff --git a/libImaging/Jpeg2K.h b/libImaging/Jpeg2K.h index b864d5e96..7bb14eb2c 100644 --- a/libImaging/Jpeg2K.h +++ b/libImaging/Jpeg2K.h @@ -40,7 +40,7 @@ typedef struct { /* PRIVATE CONTEXT (set by decoder) */ const char *error_msg; - + } JPEG2KDECODESTATE; /* -------------------------------------------------------------------- */ diff --git a/libImaging/Jpeg2KDecode.c b/libImaging/Jpeg2KDecode.c index 5afa4a23d..9140e0074 100644 --- a/libImaging/Jpeg2KDecode.c +++ b/libImaging/Jpeg2KDecode.c @@ -338,7 +338,7 @@ j2ku_srgb_rgb(opj_image_t *in, const JPEG2KTILEINFO *tileinfo, UINT8 *row = (UINT8 *)im->image[y0 + y] + x0 * 4; for (n = 0; n < 3; ++n) data[n] = &cdata[n][csiz[n] * y * w]; - + for (x = 0; x < w; ++x) { for (n = 0; n < 3; ++n) { UINT32 word = 0; @@ -391,7 +391,7 @@ j2ku_sycc_rgb(opj_image_t *in, const JPEG2KTILEINFO *tileinfo, UINT8 *row_start = row; for (n = 0; n < 3; ++n) data[n] = &cdata[n][csiz[n] * y * w]; - + for (x = 0; x < w; ++x) { for (n = 0; n < 3; ++n) { UINT32 word = 0; @@ -445,7 +445,7 @@ j2ku_srgba_rgba(opj_image_t *in, const JPEG2KTILEINFO *tileinfo, UINT8 *row = (UINT8 *)im->image[y0 + y] + x0 * 4; for (n = 0; n < 4; ++n) data[n] = &cdata[n][csiz[n] * y * w]; - + for (x = 0; x < w; ++x) { for (n = 0; n < 4; ++n) { UINT32 word = 0; @@ -497,7 +497,7 @@ j2ku_sycca_rgba(opj_image_t *in, const JPEG2KTILEINFO *tileinfo, UINT8 *row_start = row; for (n = 0; n < 4; ++n) data[n] = &cdata[n][csiz[n] * y * w]; - + for (x = 0; x < w; ++x) { for (n = 0; n < 4; ++n) { UINT32 word = 0; @@ -561,13 +561,13 @@ j2k_decode_entry(Imaging im, ImagingCodecState state) unsigned n; stream = opj_stream_create(BUFFER_SIZE, OPJ_TRUE); - + if (!stream) { state->errcode = IMAGING_CODEC_BROKEN; state->state = J2K_STATE_FAILED; goto quick_exit; } - + opj_stream_set_read_function(stream, j2k_read); opj_stream_set_skip_function(stream, j2k_skip); @@ -589,13 +589,13 @@ j2k_decode_entry(Imaging im, ImagingCodecState state) /* Setup decompression context */ context->error_msg = NULL; - + opj_set_default_decoder_parameters(¶ms); params.cp_reduce = context->reduce; params.cp_layer = context->layers; - + codec = opj_create_decompress(context->format); - + if (!codec) { state->errcode = IMAGING_CODEC_BROKEN; state->state = J2K_STATE_FAILED; @@ -618,7 +618,7 @@ j2k_decode_entry(Imaging im, ImagingCodecState state) state->state = J2K_STATE_FAILED; goto quick_exit; } - + for (n = 1; n < image->numcomps; ++n) { if (image->comps[n].dx != 1 || image->comps[n].dy != 1) { state->errcode = IMAGING_CODEC_BROKEN; @@ -626,7 +626,7 @@ j2k_decode_entry(Imaging im, ImagingCodecState state) goto quick_exit; } } - + /* Colorspace Number of components PIL mode ------------------------------------------------------ @@ -635,22 +635,22 @@ j2k_decode_entry(Imaging im, ImagingCodecState state) gray 1 L or I gray 2 LA YCC 3 YCbCr - - + + If colorspace is unspecified, we assume: - + Number of components Colorspace ----------------------------------------- 1 gray 2 gray (+ alpha) 3 sRGB 4 sRGB (+ alpha) - + */ - + /* Find the correct unpacker */ color_space = image->color_space; - + if (color_space == OPJ_CLRSPC_UNSPECIFIED) { switch (image->numcomps) { case 1: case 2: color_space = OPJ_CLRSPC_GRAY; break; @@ -756,7 +756,7 @@ j2k_decode_entry(Imaging im, ImagingCodecState state) context->pfile = NULL; } } - + quick_exit: if (codec) opj_destroy_codec(codec); @@ -783,7 +783,7 @@ ImagingJpeg2KDecode(Imaging im, ImagingCodecState state, UINT8* buf, int bytes) if (state->state == J2K_STATE_START) { state->state = J2K_STATE_DECODING; - + return j2k_decode_entry(im, state); } @@ -806,7 +806,7 @@ ImagingJpeg2KDecodeCleanup(ImagingCodecState state) { if (context->error_msg) { free ((void *)context->error_msg); } - + context->error_msg = NULL; return -1; diff --git a/libImaging/Jpeg2KEncode.c b/libImaging/Jpeg2KEncode.c index a175a04c7..92e55e190 100644 --- a/libImaging/Jpeg2KEncode.c +++ b/libImaging/Jpeg2KEncode.c @@ -70,11 +70,11 @@ j2k_skip(OPJ_OFF_T p_nb_bytes, void *p_user_data) if (!buffer) { return (OPJ_OFF_T)-1; } - + result = _imaging_write_pyFd(state->fd, buffer, p_nb_bytes); free(buffer); - + return result ? result : p_nb_bytes; } @@ -368,7 +368,7 @@ j2k_encode_entry(Imaging im, ImagingCodecState state) context->error_msg = NULL; opj_set_default_encoder_parameters(¶ms); - + params.image_offset_x0 = context->offset_x; params.image_offset_y0 = context->offset_y; diff --git a/libImaging/Pack.c b/libImaging/Pack.c index 7668dd310..8a0fcc004 100644 --- a/libImaging/Pack.c +++ b/libImaging/Pack.c @@ -388,7 +388,7 @@ packI16N_I16B(UINT8* out, const UINT8* in, int pixels){ C16B; out += 2; tmp += 2; } - + } static void packI16N_I16(UINT8* out, const UINT8* in, int pixels){ diff --git a/libImaging/Quant.c b/libImaging/Quant.c index 7d24e7812..25aa7f079 100644 --- a/libImaging/Quant.c +++ b/libImaging/Quant.c @@ -1114,7 +1114,7 @@ k_means(Pixel *pixelData, goto error_1; } } - + /* this is enough of a check, since the multiplication n*size is done above */ if (nPaletteEntries > UINT32_MAX / nPaletteEntries) { goto error_1; @@ -1425,7 +1425,7 @@ quantize2(Pixel *pixelData, uint32_t *qp; uint32_t *avgDist; uint32_t **avgDistSortKey; - + /* malloc check ok, using calloc */ p=calloc(nQuantPixels, sizeof(Pixel)); if (!p) return 0; diff --git a/libImaging/QuantHeap.c b/libImaging/QuantHeap.c index d6b920787..121b87275 100644 --- a/libImaging/QuantHeap.c +++ b/libImaging/QuantHeap.c @@ -137,7 +137,7 @@ int ImagingQuantHeapTop(Heap *h,void **r) { Heap *ImagingQuantHeapNew(HeapCmpFunc cf) { Heap *h; - + /* malloc check ok, small constant allocation */ h=malloc(sizeof(Heap)); if (!h) return NULL; diff --git a/libImaging/RankFilter.c b/libImaging/RankFilter.c index c0cb364c9..cfcc7ef38 100644 --- a/libImaging/RankFilter.c +++ b/libImaging/RankFilter.c @@ -59,7 +59,7 @@ ImagingRankFilter(Imaging im, int size, int rank) if (!(size & 1)) return (Imaging) ImagingError_ValueError("bad filter size"); - + /* malloc check ok, for overflow in the define below */ if (size > INT_MAX / size || size > INT_MAX / (size * sizeof(FLOAT32))) { diff --git a/libImaging/Unpack.c b/libImaging/Unpack.c index 8112afd8d..dfc8a4d7e 100644 --- a/libImaging/Unpack.c +++ b/libImaging/Unpack.c @@ -906,7 +906,7 @@ unpackI16N_I16B(UINT8* out, const UINT8* in, int pixels){ C16B; in += 2; tmp += 2; } - + } static void unpackI16N_I16(UINT8* out, const UINT8* in, int pixels){ @@ -921,7 +921,7 @@ unpackI16N_I16(UINT8* out, const UINT8* in, int pixels){ static void unpackI12_I16(UINT8* out, const UINT8* in, int pixels){ /* Fillorder 1/MSB -> LittleEndian, for 12bit integer greyscale tiffs. - + According to the TIFF spec: FillOrder = 2 should be used only when BitsPerSample = 1 and @@ -958,7 +958,7 @@ unpackI12_I16(UINT8* out, const UINT8* in, int pixels){ #else out16[1] = pixel; #endif - + in += 3; out16 += 2; out+=4; } if (i == pixels-1) { diff --git a/libImaging/ZipEncode.c b/libImaging/ZipEncode.c index d642e6da2..0c6f34242 100644 --- a/libImaging/ZipEncode.c +++ b/libImaging/ZipEncode.c @@ -42,7 +42,7 @@ ImagingZipEncode(Imaging im, ImagingCodecState state, UINT8* buf, int bytes) state->errcode = IMAGING_CODEC_MEMORY; return -1; } - + /* Expand standard buffer to make room for the filter selector, and allocate filter buffers */ free(state->buffer); diff --git a/libImaging/codec_fd.c b/libImaging/codec_fd.c index d6590629c..7bd4dadf8 100644 --- a/libImaging/codec_fd.c +++ b/libImaging/codec_fd.c @@ -20,11 +20,11 @@ _imaging_read_pyFd(PyObject *fd, char* dest, Py_ssize_t bytes) if (bytes_result == -1) { goto err; } - + if (length > bytes) { goto err; } - + memcpy(dest, buffer, length); Py_DECREF(result); @@ -33,7 +33,7 @@ _imaging_read_pyFd(PyObject *fd, char* dest, Py_ssize_t bytes) err: Py_DECREF(result); return -1; - + } Py_ssize_t @@ -42,7 +42,7 @@ _imaging_write_pyFd(PyObject *fd, char* src, Py_ssize_t bytes) PyObject *result; PyObject *byteObj; - + byteObj = PyBytes_FromStringAndSize(src, bytes); result = PyObject_CallMethod(fd, "write", "O", byteObj); @@ -50,14 +50,14 @@ _imaging_write_pyFd(PyObject *fd, char* src, Py_ssize_t bytes) Py_DECREF(result); return bytes; - + } int _imaging_seek_pyFd(PyObject *fd, Py_ssize_t offset, int whence) { PyObject *result; - + result = PyObject_CallMethod(fd, "seek", "ni", offset, whence); Py_DECREF(result); @@ -70,7 +70,7 @@ _imaging_tell_pyFd(PyObject *fd) { PyObject *result; Py_ssize_t location; - + result = PyObject_CallMethod(fd, "tell", NULL); location = PyInt_AsSsize_t(result); diff --git a/winbuild/build.py b/winbuild/build.py index 6156010cf..a58600b29 100644 --- a/winbuild/build.py +++ b/winbuild/build.py @@ -153,7 +153,7 @@ if __name__ == '__main__': op = "bdist_wininst --user-access-control=auto" elif '--wheel' in opts: op = "bdist_wheel" - + if 'PYTHON' in os.environ: run_one(op) else: