Skip to content

Commit

Permalink
Removed trailing whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Jul 1, 2016
1 parent b69596a commit ebf2121
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Changelog (Pillow)
[AbdealiJK]

- Binary Tiff Metadata/ICC profile. #1988
[wiredfool]
[wiredfool]

- Ignore large text blocks in PNG if LOAD_TRUNCATED_IMAGES is enabled #1970
[homm]
Expand Down
2 changes: 1 addition & 1 deletion docs/handbook/image-file-formats.rst
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ The :py:meth:`~PIL.Image.Image.save` method supports the following options:
(it is set to 9 regardless of a value passed).

**icc_profile**
The ICC Profile to include in the saved file.
The ICC Profile to include in the saved file.

**bits (experimental)**
For ``P`` images, this option controls how many bits to store. If omitted,
Expand Down
16 changes: 8 additions & 8 deletions docs/handbook/writing-your-own-file-decoder.rst
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ There are 3 stages in a file decoder's lifetime:


Setup
-----
-----

The current conventions are that the decoder setup function is named
``PyImaging_[Decodername]DecoderNew`` and defined in ``decode.c``. The
Expand All @@ -334,23 +334,23 @@ The setup function needs to call ``PyImaging_DecoderNew`` and at the
very least, set the ``decode`` function pointer. The fields of
interest in this object are:

**decode**
**decode**
Function pointer to the decode function, which has access to
``im``, ``state``, and the buffer of data to be added to the image.

**cleanup**
**cleanup**
Function pointer to the cleanup function, has access to ``state``.

**im**
The target image, will be set by Pillow.
**im**
The target image, will be set by Pillow.

**state**
An ImagingCodecStateInstance, will be set by Pillow. The **context**
member is an opaque struct that can be used by the decoder to store
any format specific state or options.

**handles_eof**
UNDONE, set if your code handles EOF errors.
UNDONE, set if your code handles EOF errors.

**pulls_fd**
**EXPERIMENTAL** -- **WARNING**, interface may change. If set to 1,
Expand Down Expand Up @@ -380,9 +380,9 @@ call to the decoder will include the previous unconsumed tail. The
decoder function will be called multiple times as the data is read
from the file like object.

If an error occurs, set ``state->errcode`` and return -1.
If an error occurs, set ``state->errcode`` and return -1.

Return -1 on success, without setting the errcode.
Return -1 on success, without setting the errcode.

Cleanup
-------
Expand Down
2 changes: 1 addition & 1 deletion docs/releasenotes/3.3.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Rotation

Rotation for angles divisible by 90 degrees now always uses transposition.
This greatly improve both quality and performance in this cases.
Also, the bug with wrong image size calculation when rotating by 90 degrees
Also, the bug with wrong image size calculation when rotating by 90 degrees
was fixed.


Expand Down
2 changes: 1 addition & 1 deletion libImaging/Draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ polygon_generic(Imaging im, int n, Edge *e, int ink, int eofill,
}

/* Process the edge table with a scan line searching for intersections */
/* malloc check ok, using calloc */
/* malloc check ok, using calloc */
xx = calloc(edge_count * 2, sizeof(float));
if (!xx) {
free(edge_table);
Expand Down
2 changes: 1 addition & 1 deletion libImaging/Jpeg2KDecode.c
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ ImagingJpeg2KDecode(Imaging im, ImagingCodecState state, UINT8* buf, int bytes)
state->errcode = IMAGING_CODEC_BROKEN;
state->state = J2K_STATE_FAILED;
return -1;
}
}

if (state->state == J2K_STATE_DONE || state->state == J2K_STATE_FAILED)
return -1;
Expand Down
2 changes: 1 addition & 1 deletion libImaging/Quant.c
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@ compute_palette_from_median_cut(
avg[i]=NULL;
}
for(i=0;i<3;i++) {
/* malloc check ok, using calloc */
/* malloc check ok, using calloc */
if (!(avg[i]=calloc(nPaletteEntries, sizeof(uint32_t)))) {
for(i=0;i<3;i++) {
if (avg[i]) free (avg[i]);
Expand Down
8 changes: 4 additions & 4 deletions libImaging/QuantHeap.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static int _heap_grow(Heap *h,int newsize) {
if (newsize > INT_MAX / sizeof(void *)){
return 0;
}
/* malloc check ok, using calloc for overflow, also checking
/* malloc check ok, using calloc for overflow, also checking
above due to memcpy below*/
newheap=calloc(newsize, sizeof(void *));
if (!newheap) return 0;
Expand Down Expand Up @@ -144,9 +144,9 @@ Heap *ImagingQuantHeapNew(HeapCmpFunc cf) {
h->heapsize=INITIAL_SIZE;
/* malloc check ok, using calloc for overflow */
h->heap=calloc(h->heapsize, sizeof(void *));
if (!h->heap) {
free(h);
return NULL;
if (!h->heap) {
free(h);
return NULL;
}
h->heapcount=0;
h->cf=cf;
Expand Down
2 changes: 1 addition & 1 deletion libImaging/RankFilter.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ ImagingRankFilter(Imaging im, int size, int rank)
return (Imaging) ImagingError_ValueError("bad filter size");

/* malloc check ok, for overflow in the define below */
if (size > INT_MAX / size ||
if (size > INT_MAX / size ||
size > INT_MAX / (size * sizeof(FLOAT32))) {
return (Imaging) ImagingError_ValueError("filter size too large");
}
Expand Down
12 changes: 6 additions & 6 deletions libImaging/codec_fd.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "../py3.h"


Py_ssize_t
Py_ssize_t
_imaging_read_pyFd(PyObject *fd, char* dest, Py_ssize_t bytes)
{
/* dest should be a buffer bytes long, returns length of read
Expand All @@ -17,26 +17,26 @@ _imaging_read_pyFd(PyObject *fd, char* dest, Py_ssize_t bytes)
result = PyObject_CallMethod(fd, "read", "n", bytes);

bytes_result = PyBytes_AsStringAndSize(result, &buffer, &length);
if (bytes_result == -1) {
if (bytes_result == -1) {
goto err;
}

if (length > bytes) {
goto err;
}

memcpy(dest, buffer, length);
memcpy(dest, buffer, length);

Py_DECREF(result);
return length;

err:
Py_DECREF(result);
return -1;
return -1;

}

Py_ssize_t
Py_ssize_t
_imaging_write_pyFd(PyObject *fd, char* src, Py_ssize_t bytes)
{

Expand All @@ -60,7 +60,7 @@ _imaging_seek_pyFd(PyObject *fd, Py_ssize_t offset, int whence)

result = PyObject_CallMethod(fd, "seek", "ni", offset, whence);

Py_DECREF(result);
Py_DECREF(result);
return 0;

}
Expand Down

0 comments on commit ebf2121

Please sign in to comment.