Commit Graph

8677 Commits

Author SHA1 Message Date
Rolf Eike Beer
220bfee19a replace copy operations with memcpy()
This replaces trivial instances where a copy from one pointer to the other
involves no further calculations or casts. The compiler will optimize this to
whatever the platform offers.
2019-06-29 19:30:24 +02:00
Hugo
af0d90a054
Merge pull request #3923 from cgohlke/patch-1
Use unsigned int to store TIFF IFD offsets
2019-06-29 11:02:10 +03:00
Hugo
d19ed257c4
Merge pull request #3819 from jefferyto/patch-1
Include CPPFLAGS when searching for libraries
2019-06-29 10:27:43 +03:00
Hugo
0e7358a046
Updated TIFF tile descriptors to match current decoding functio… (#3795)
Updated TIFF tile descriptors to match current decoding functionality
2019-06-29 10:27:00 +03:00
Hugo
08c47925d0
Added an image.entropy() method (#3608)
Added an `image.entropy()` method
2019-06-29 10:12:34 +03:00
Hugo
2fe3a39c53
Merge pull request #3925 from radarhere/python38
Split pytest flags
2019-06-29 10:06:32 +03:00
Andrew Murray
6940c1142c Split pytest flags 2019-06-29 15:47:46 +10:00
Andrew Murray
07ec99d545 Updated CHANGES.rst [ci skip] 2019-06-29 08:03:40 +10:00
Hugo
a96482bba0
Pass the correct types to PyArg_ParseTuple (#3880)
Pass the correct types to PyArg_ParseTuple
2019-06-28 21:49:54 +03:00
Hugo
a0191dae1e
Documentation for Image module (#3776)
Documentation for Image module
2019-06-28 19:49:45 +03:00
Hugo
57e3af4afb Fix typo 2019-06-28 18:47:17 +03:00
Christoph Gohlke
59e1328272
Use unsigned int to store TIFF IFD offsets 2019-06-27 15:30:19 -07:00
Christoph Gohlke
129df60c48
Use unsigned int to store TIFF IFD offsets 2019-06-27 15:09:31 -07:00
Christoph Gohlke
2ebde32852
Use unsigned int to store TIFF IFD offsets 2019-06-27 15:07:52 -07:00
Hugo
119d1c927b
Merge pull request #3922 from radarhere/param
Improved parameter documentation
2019-06-28 00:25:41 +03:00
Hugo
372c7c352a
Merge pull request #3703 from jkrshnmenon/master
Add an upper limit for blocks_max in _set_blocks_max
2019-06-27 23:03:25 +03:00
Hugo
b584635a8c
Merge pull request #3912 from radarhere/non_font_bytes
Fixed crash when loading non-font bytes
2019-06-27 22:40:29 +03:00
Hugo
219f277129
Merge pull request #3858 from kulikjak/master
Fix SPARC memory alignment issues in Pack/Unpack functions
2019-06-27 21:27:37 +03:00
Andrew Murray
e319e32cec Improved parameter documentation [ci skip] 2019-06-27 22:53:46 +10:00
Andrew Murray
8b447c4840 Lint fixes 2019-06-26 19:16:36 +10:00
Andrew Murray
1a71faf8ea Removed variable 2019-06-26 19:15:47 +10:00
Alexander Böhn
7b815a5f1d Added an image.entropy() method
This calculates the entropy for the image, based on the histogram.

Because this uses image histogram data directly, the existing C
function underpinning the `image.histogram()` method was abstracted
into a static function to parse extrema tuple arguments, and a new
C function was added to calculate image entropy, making use of the
new static extrema function.

The extrema-parsing function was written by @homm, based on the
macro abstraction I wrote, during the discussion of my first
entropy-method pull request: https://git.io/fhodS

The new `image.entropy()` method is based on `image.histogram()`,
and will accept the same arguments to calculate the histogram data
it will use to assess the entropy of the image.

The algorithm and methodology is based on existing Python code:

* https://git.io/fhmIU

... A test case in the `Tests/` directory, and doctest lines in
`selftest.py`, have both been added and checked.

Changes proposed in this pull request:

* Added “math.h” include to _imaging.c
* The addition of an `image.entropy()` method to the `Image`
  Python class,
* The abstraction of the extrema-parsing logic of of the C
  function `_histogram` into a static function, and
* The use of that static function in both the `_histogram` and
  `_entropy` C functions.
* Minor documentation addenda in the docstrings for both the
  `image.entropy()` and `image.histogram()` methods were also
  added.
* Removed outdated boilerplate from testing code
* Removed unused “unittest” import
2019-06-26 19:15:47 +10:00
Hugo
a79147ff96
Merge pull request #3916 from cgohlke/patch-1
Fix memory leak
2019-06-26 12:09:50 +03:00
Hugo
f2d0106a9b
Merge pull request #3917 from cgohlke/patch-2
Fix potential null pointer is passed into memcpy
2019-06-26 12:09:22 +03:00
Andrew Murray
f22198e3bc Lint fixes 2019-06-26 19:09:02 +10:00
Hugo
2aaacc8849
Merge pull request #3918 from cgohlke/patch-3
Use ssize_t to store number of elements in buffer
2019-06-26 12:08:35 +03:00
Andrew Murray
d591cf8d3f Error is not raised on 64-bit systems 2019-06-26 19:08:07 +10:00
Jayakrishna Menon
590b5b7f9e test case for set_blocks_max 2019-06-26 19:08:07 +10:00
Jayakrishna Menon
2acc098cab adding testcase for overflow 2019-06-26 19:08:07 +10:00
Jayakrishna Menon
494fb25bdb adding testcase for overflow 2019-06-26 19:08:07 +10:00
Jayakrishna Menon
37516fb665 adding an upper limit for blocks_max in _set_blocks_max 2019-06-26 19:08:07 +10:00
Christoph Gohlke
afed559e4f
Fix msvc9 compile error 2019-06-25 17:18:37 -07:00
Christoph Gohlke
c34cefb576
Use ssize_t to store number of elements in buffer 2019-06-25 14:41:06 -07:00
Christoph Gohlke
a78341e26c
Fix potential null pointer is passed into memcpy 2019-06-25 14:23:20 -07:00
Christoph Gohlke
47f7eba279
Fix memory leak 2019-06-25 13:33:49 -07:00
Hugo
ea570a8c5b
Merge pull request #3915 from radarhere/typo
Fixed typos
2019-06-25 11:41:58 +03:00
Hugo
d31069072b
Added CMYK;16B and CMYK;16N unpackers (#3913)
Added CMYK;16B and CMYK;16N unpackers
2019-06-25 11:41:51 +03:00
Andrew Murray
78d4b7f03e Fixed typos 2019-06-25 05:54:14 +10:00
Hugo
73884576d4 Some styling and wording 2019-06-24 11:04:13 +03:00
Hugo
72bf9f6529 Use the common test-suite image 2019-06-24 10:48:33 +03:00
Hugo
fd1d779ae1 Strip trailing whitespace 2019-06-24 10:45:53 +03:00
Andrew Murray
d00e18b017 Updated test result 2019-06-23 14:01:51 +10:00
David Nisson
ddb61cfbd2 updated tests to match new tile descriptors 2019-06-23 13:59:20 +10:00
David Nisson
5857bf8243 corrected args to reflect change to tile descriptors 2019-06-23 13:49:41 +10:00
David Nisson
cb7d9bcd12 updated TIFF tile descriptors to match current decoding functionality 2019-06-23 13:49:15 +10:00
Jeffery To
4119d3015b Include CPPFLAGS when searching for libraries
This adds CPPFLAGS to the list of environment variables (currently
CFLAGS and LDFLAGS) searched when looking for includes and library
directories, as CPPFLAGS may also include -I options.
2019-06-23 12:06:06 +10:00
Andrew Murray
9c37933bb9 Added CMYK;16B and CMYK;16N unpackers 2019-06-23 11:56:17 +10:00
Andrew Murray
7bb16de81c Fixed crash when loading non-font bytes 2019-06-23 11:53:01 +10:00
Andrew Murray
32d10505a3
Merge pull request #3914 from radarhere/black
Fixed black formatting
2019-06-23 07:17:45 +10:00
Hugo
c1b3adbd1b
Merge pull request #3910 from radarhere/xrgb
Changed bits value for XRGB unpackers
2019-06-22 10:24:24 +03:00