mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-12 18:26:17 +03:00
Merge pull request #2002 from radarhere/whitespace
Removed trailing whitespace
This commit is contained in:
commit
c212246b1e
|
@ -38,7 +38,7 @@ Changelog (Pillow)
|
||||||
[AbdealiJK]
|
[AbdealiJK]
|
||||||
|
|
||||||
- Binary Tiff Metadata/ICC profile. #1988
|
- Binary Tiff Metadata/ICC profile. #1988
|
||||||
[wiredfool]
|
[wiredfool]
|
||||||
|
|
||||||
- Ignore large text blocks in PNG if LOAD_TRUNCATED_IMAGES is enabled #1970
|
- Ignore large text blocks in PNG if LOAD_TRUNCATED_IMAGES is enabled #1970
|
||||||
[homm]
|
[homm]
|
||||||
|
|
|
@ -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).
|
(it is set to 9 regardless of a value passed).
|
||||||
|
|
||||||
**icc_profile**
|
**icc_profile**
|
||||||
The ICC Profile to include in the saved file.
|
The ICC Profile to include in the saved file.
|
||||||
|
|
||||||
**bits (experimental)**
|
**bits (experimental)**
|
||||||
For ``P`` images, this option controls how many bits to store. If omitted,
|
For ``P`` images, this option controls how many bits to store. If omitted,
|
||||||
|
|
|
@ -322,7 +322,7 @@ There are 3 stages in a file decoder's lifetime:
|
||||||
|
|
||||||
|
|
||||||
Setup
|
Setup
|
||||||
-----
|
-----
|
||||||
|
|
||||||
The current conventions are that the decoder setup function is named
|
The current conventions are that the decoder setup function is named
|
||||||
``PyImaging_[Decodername]DecoderNew`` and defined in ``decode.c``. The
|
``PyImaging_[Decodername]DecoderNew`` and defined in ``decode.c``. The
|
||||||
|
@ -334,15 +334,15 @@ The setup function needs to call ``PyImaging_DecoderNew`` and at the
|
||||||
very least, set the ``decode`` function pointer. The fields of
|
very least, set the ``decode`` function pointer. The fields of
|
||||||
interest in this object are:
|
interest in this object are:
|
||||||
|
|
||||||
**decode**
|
**decode**
|
||||||
Function pointer to the decode function, which has access to
|
Function pointer to the decode function, which has access to
|
||||||
``im``, ``state``, and the buffer of data to be added to the image.
|
``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``.
|
Function pointer to the cleanup function, has access to ``state``.
|
||||||
|
|
||||||
**im**
|
**im**
|
||||||
The target image, will be set by Pillow.
|
The target image, will be set by Pillow.
|
||||||
|
|
||||||
**state**
|
**state**
|
||||||
An ImagingCodecStateInstance, will be set by Pillow. The **context**
|
An ImagingCodecStateInstance, will be set by Pillow. The **context**
|
||||||
|
@ -350,7 +350,7 @@ interest in this object are:
|
||||||
any format specific state or options.
|
any format specific state or options.
|
||||||
|
|
||||||
**handles_eof**
|
**handles_eof**
|
||||||
UNDONE, set if your code handles EOF errors.
|
UNDONE, set if your code handles EOF errors.
|
||||||
|
|
||||||
**pulls_fd**
|
**pulls_fd**
|
||||||
**EXPERIMENTAL** -- **WARNING**, interface may change. If set to 1,
|
**EXPERIMENTAL** -- **WARNING**, interface may change. If set to 1,
|
||||||
|
@ -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
|
decoder function will be called multiple times as the data is read
|
||||||
from the file like object.
|
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
|
Cleanup
|
||||||
-------
|
-------
|
||||||
|
|
|
@ -42,7 +42,7 @@ Rotation
|
||||||
|
|
||||||
Rotation for angles divisible by 90 degrees now always uses transposition.
|
Rotation for angles divisible by 90 degrees now always uses transposition.
|
||||||
This greatly improve both quality and performance in this cases.
|
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.
|
was fixed.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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 */
|
/* 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));
|
xx = calloc(edge_count * 2, sizeof(float));
|
||||||
if (!xx) {
|
if (!xx) {
|
||||||
free(edge_table);
|
free(edge_table);
|
||||||
|
|
|
@ -776,7 +776,7 @@ ImagingJpeg2KDecode(Imaging im, ImagingCodecState state, UINT8* buf, int bytes)
|
||||||
state->errcode = IMAGING_CODEC_BROKEN;
|
state->errcode = IMAGING_CODEC_BROKEN;
|
||||||
state->state = J2K_STATE_FAILED;
|
state->state = J2K_STATE_FAILED;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state->state == J2K_STATE_DONE || state->state == J2K_STATE_FAILED)
|
if (state->state == J2K_STATE_DONE || state->state == J2K_STATE_FAILED)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -971,7 +971,7 @@ compute_palette_from_median_cut(
|
||||||
avg[i]=NULL;
|
avg[i]=NULL;
|
||||||
}
|
}
|
||||||
for(i=0;i<3;i++) {
|
for(i=0;i<3;i++) {
|
||||||
/* malloc check ok, using calloc */
|
/* malloc check ok, using calloc */
|
||||||
if (!(avg[i]=calloc(nPaletteEntries, sizeof(uint32_t)))) {
|
if (!(avg[i]=calloc(nPaletteEntries, sizeof(uint32_t)))) {
|
||||||
for(i=0;i<3;i++) {
|
for(i=0;i<3;i++) {
|
||||||
if (avg[i]) free (avg[i]);
|
if (avg[i]) free (avg[i]);
|
||||||
|
|
|
@ -51,7 +51,7 @@ static int _heap_grow(Heap *h,int newsize) {
|
||||||
if (newsize > INT_MAX / sizeof(void *)){
|
if (newsize > INT_MAX / sizeof(void *)){
|
||||||
return 0;
|
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*/
|
above due to memcpy below*/
|
||||||
newheap=calloc(newsize, sizeof(void *));
|
newheap=calloc(newsize, sizeof(void *));
|
||||||
if (!newheap) return 0;
|
if (!newheap) return 0;
|
||||||
|
@ -144,9 +144,9 @@ Heap *ImagingQuantHeapNew(HeapCmpFunc cf) {
|
||||||
h->heapsize=INITIAL_SIZE;
|
h->heapsize=INITIAL_SIZE;
|
||||||
/* malloc check ok, using calloc for overflow */
|
/* malloc check ok, using calloc for overflow */
|
||||||
h->heap=calloc(h->heapsize, sizeof(void *));
|
h->heap=calloc(h->heapsize, sizeof(void *));
|
||||||
if (!h->heap) {
|
if (!h->heap) {
|
||||||
free(h);
|
free(h);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
h->heapcount=0;
|
h->heapcount=0;
|
||||||
h->cf=cf;
|
h->cf=cf;
|
||||||
|
|
|
@ -61,7 +61,7 @@ ImagingRankFilter(Imaging im, int size, int rank)
|
||||||
return (Imaging) ImagingError_ValueError("bad filter size");
|
return (Imaging) ImagingError_ValueError("bad filter size");
|
||||||
|
|
||||||
/* malloc check ok, for overflow in the define below */
|
/* 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))) {
|
size > INT_MAX / (size * sizeof(FLOAT32))) {
|
||||||
return (Imaging) ImagingError_ValueError("filter size too large");
|
return (Imaging) ImagingError_ValueError("filter size too large");
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#include "../py3.h"
|
#include "../py3.h"
|
||||||
|
|
||||||
|
|
||||||
Py_ssize_t
|
Py_ssize_t
|
||||||
_imaging_read_pyFd(PyObject *fd, char* dest, Py_ssize_t bytes)
|
_imaging_read_pyFd(PyObject *fd, char* dest, Py_ssize_t bytes)
|
||||||
{
|
{
|
||||||
/* dest should be a buffer bytes long, returns length of read
|
/* dest should be a buffer bytes long, returns length of read
|
||||||
|
@ -17,7 +17,7 @@ _imaging_read_pyFd(PyObject *fd, char* dest, Py_ssize_t bytes)
|
||||||
result = PyObject_CallMethod(fd, "read", "n", bytes);
|
result = PyObject_CallMethod(fd, "read", "n", bytes);
|
||||||
|
|
||||||
bytes_result = PyBytes_AsStringAndSize(result, &buffer, &length);
|
bytes_result = PyBytes_AsStringAndSize(result, &buffer, &length);
|
||||||
if (bytes_result == -1) {
|
if (bytes_result == -1) {
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,18 +25,18 @@ _imaging_read_pyFd(PyObject *fd, char* dest, Py_ssize_t bytes)
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(dest, buffer, length);
|
memcpy(dest, buffer, length);
|
||||||
|
|
||||||
Py_DECREF(result);
|
Py_DECREF(result);
|
||||||
return length;
|
return length;
|
||||||
|
|
||||||
err:
|
err:
|
||||||
Py_DECREF(result);
|
Py_DECREF(result);
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Py_ssize_t
|
Py_ssize_t
|
||||||
_imaging_write_pyFd(PyObject *fd, char* src, Py_ssize_t bytes)
|
_imaging_write_pyFd(PyObject *fd, char* src, Py_ssize_t bytes)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ _imaging_seek_pyFd(PyObject *fd, Py_ssize_t offset, int whence)
|
||||||
|
|
||||||
result = PyObject_CallMethod(fd, "seek", "ni", offset, whence);
|
result = PyObject_CallMethod(fd, "seek", "ni", offset, whence);
|
||||||
|
|
||||||
Py_DECREF(result);
|
Py_DECREF(result);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user