Skip to content

Commit

Permalink
Merge branch 'master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Jun 22, 2019
2 parents 7ee693d + f5cd8b4 commit a5208c2
Show file tree
Hide file tree
Showing 347 changed files with 9,809 additions and 7,595 deletions.
4 changes: 1 addition & 3 deletions .github/CONTRIBUTING.md
Expand Up @@ -34,6 +34,4 @@ The best reproductions are self-contained scripts with minimal dependencies. If

## Security vulnerabilities

To report sensitive vulnerability information, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.

If your organisation/employer is a distributor of Pillow and would like advance notification of security-related bugs, please let us know your preferred contact method.
Please see our [security policy](https://github.com/python-pillow/Pillow/blob/master/.github/SECURITY.md).
1 change: 1 addition & 0 deletions .github/FUNDING.yml
@@ -0,0 +1 @@
tidelift: pypi/pillow
19 changes: 0 additions & 19 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

59 changes: 59 additions & 0 deletions .github/ISSUE_TEMPLATE/ISSUE_REPORT.md
@@ -0,0 +1,59 @@
---
name: Issue report
about: Create a report to help us improve Pillow
---

<!--
Thank you for reporting an issue.
Follow these guidelines to ensure your issue is handled properly.
If you have a ...
1. General question: consider asking the question on Stack Overflow
with the python-imaging-library tag:
* https://stackoverflow.com/questions/tagged/python-imaging-library
Do not ask a question in both places.
If you think you have found a bug or have an unexplained exception
then file a bug report here.
2. Bug report: include a self-contained, copy-pastable example that
generates the issue if possible. Be concise with code posted.
Guidelines on how to provide a good bug report:
* https://stackoverflow.com/help/mcve
Bug reports which follow these guidelines are easier to diagnose,
and are often handled much more quickly.
3. Feature request: do a quick search of existing issues
to make sure this has not been asked before.
We know asking good questions takes effort, and we appreciate your time.
Thank you.
-->

### What did you do?

### What did you expect to happen?

### What actually happened?

### What are your OS, Python and Pillow versions?

* OS:
* Python:
* Pillow:

<!--
Please include **code** that reproduces the issue and whenever possible, an **image** that demonstrates the issue. Please upload images to GitHub, not to third-party file hosting sites. If necessary, add the image to a zip or tar archive.
The best reproductions are self-contained scripts with minimal dependencies. If you are using a framework such as Plone, Django, or Buildout, try to replicate the issue just using Pillow.
-->

```python
code goes here
```
5 changes: 5 additions & 0 deletions .github/SECURITY.md
@@ -0,0 +1,5 @@
# Security policy

To report sensitive vulnerability information, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.

If your organisation/employer is a distributor of Pillow and would like advance notification of security-related bugs, please let us know your preferred contact method.
6 changes: 3 additions & 3 deletions .travis.yml
Expand Up @@ -16,9 +16,9 @@ matrix:
- python: "3.6"
name: "Lint"
env: LINT="true"
- python: "pypy2.7-6.0"
- python: "pypy"
name: "PyPy2 Xenial"
- python: "pypy3.5-6.0"
- python: "pypy3"
name: "PyPy3 Xenial"
- python: '3.7'
name: "3.7 Xenial"
Expand All @@ -44,8 +44,8 @@ matrix:
- env: DOCKER="centos-7-amd64" DOCKER_TAG="master"
- env: DOCKER="amazon-1-amd64" DOCKER_TAG="master"
- env: DOCKER="amazon-2-amd64" DOCKER_TAG="master"
- env: DOCKER="fedora-28-amd64" DOCKER_TAG="master"
- env: DOCKER="fedora-29-amd64" DOCKER_TAG="master"
- env: DOCKER="fedora-30-amd64" DOCKER_TAG="master"

services:
- docker
Expand Down
76 changes: 74 additions & 2 deletions CHANGES.rst
Expand Up @@ -5,7 +5,79 @@ Changelog (Pillow)
6.1.0 (unreleased)
------------------

- Depends: Updated openjpeg to 2.3.1 #3794
- Fixed bugs in calculating text size #3864
[radarhere]

- Add __main__.py to output basic format and support information #3870
[jdufresne]

- Added variation font support #3802
[radarhere]

- Do not down-convert if image is LA when showing with PNG format #3869
[radarhere]

- Improve handling of PSD frames #3759
[radarhere]

- Improved ICO and ICNS loading #3897
[radarhere]

- Changed Preview application path so that it is no longer static #3896
[radarhere]

- Corrected ttb text positioning #3856
[radarhere]

- Handle unexpected ICO image sizes #3836
[radarhere]

- Fixed bits value for RGB;16N unpackers #3837
[kkopachev]

- Travis CI: Add Fedora 30, remove Fedora 28 #3821
[hugovk]

- Added reading of CMYK;16L TIFF images #3817
[radarhere]

- Fixed dimensions of 1-bit PDFs #3827
[radarhere]

- Fixed opening mmap image through Path on Windows #3825
[radarhere]

- Fixed ImageDraw arc gaps #3824
[radarhere]

- Expand GIF to include frames with extents outside the image size #3822
[radarhere]

- Fixed ImageTk getimage #3814
[radarhere]

- Fixed bug in decoding large images #3791
[radarhere]

- Fixed reading APP13 marker without Photoshop data #3771
[radarhere]

- Added option to include layered windows in ImageGrab.grab on Windows #3808
[radarhere]

- Detect libimagequant when installed by pacman on MingW #3812
[radarhere]

- Fixed raqm layout bug #3787
[radarhere]

- Fixed loading font with non-Unicode path on Windows #3785
[radarhere]

- Travis CI: Upgrade PyPy from 6.0.0 to 7.1.1 #3783
[hugovk, johnthagen]

- Depends: Updated openjpeg to 2.3.1 #3794, raqm to 0.7.0 #3877, libimagequant to 2.12.3 #3889
[radarhere]

- Fix numpy bool bug #3790
Expand Down Expand Up @@ -1417,7 +1489,7 @@ Changelog (Pillow)
- Test: Faster assert_image_similar #2279
[homm]

- Removed depreciated internal "stretch" method #2276
- Removed deprecated internal "stretch" method #2276
[homm]

- Removed the handles_eof flag in decode.c #2223
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Expand Up @@ -4,7 +4,7 @@ Pillow
Python Imaging Library (Fork)
-----------------------------

Pillow is the friendly PIL fork by `Alex Clark and Contributors <https://github.com/python-pillow/Pillow/graphs/contributors>`_. PIL is the Python Imaging Library by Fredrik Lundh and Contributors.
Pillow is the friendly PIL fork by `Alex Clark and Contributors <https://github.com/python-pillow/Pillow/graphs/contributors>`_. PIL is the Python Imaging Library by Fredrik Lundh and Contributors. As of 2019, Pillow development is `supported by Tidelift <https://tidelift.com/subscription/pkg/pypi-pillow>`_.

.. start-badges
Expand Down
4 changes: 2 additions & 2 deletions Tests/32bit_segfault_check.py
Expand Up @@ -4,5 +4,5 @@
import sys


if sys.maxsize < 2**32:
im = Image.new('L', (999999, 999999), 0)
if sys.maxsize < 2 ** 32:
im = Image.new("L", (999999, 999999), 0)
27 changes: 15 additions & 12 deletions Tests/bench_cffi_access.py
Expand Up @@ -26,18 +26,21 @@ def timer(func, label, *args):
starttime = time.time()
for x in range(iterations):
func(*args)
if time.time()-starttime > 10:
print("%s: breaking at %s iterations, %.6f per iteration" % (
label, x+1, (time.time()-starttime)/(x+1.0)))
if time.time() - starttime > 10:
print(
"%s: breaking at %s iterations, %.6f per iteration"
% (label, x + 1, (time.time() - starttime) / (x + 1.0))
)
break
if x == iterations-1:
if x == iterations - 1:
endtime = time.time()
print("%s: %.4f s %.6f per iteration" % (
label, endtime-starttime, (endtime-starttime)/(x+1.0)))
print(
"%s: %.4f s %.6f per iteration"
% (label, endtime - starttime, (endtime - starttime) / (x + 1.0))
)


class BenchCffiAccess(PillowTestCase):

def test_direct(self):
im = hopper()
im.load()
Expand All @@ -48,11 +51,11 @@ def test_direct(self):
self.assertEqual(caccess[(0, 0)], access[(0, 0)])

print("Size: %sx%s" % im.size)
timer(iterate_get, 'PyAccess - get', im.size, access)
timer(iterate_set, 'PyAccess - set', im.size, access)
timer(iterate_get, 'C-api - get', im.size, caccess)
timer(iterate_set, 'C-api - set', im.size, caccess)
timer(iterate_get, "PyAccess - get", im.size, access)
timer(iterate_set, "PyAccess - set", im.size, access)
timer(iterate_get, "C-api - get", im.size, caccess)
timer(iterate_set, "C-api - set", im.size, caccess)


if __name__ == '__main__':
if __name__ == "__main__":
unittest.main()
1 change: 1 addition & 0 deletions Tests/bench_get.py
Expand Up @@ -2,6 +2,7 @@
import timeit

import sys

sys.path.insert(0, ".")


Expand Down
2 changes: 1 addition & 1 deletion Tests/check_fli_overflow.py
Expand Up @@ -12,5 +12,5 @@ def test_fli_overflow(self):
im.load()


if __name__ == '__main__':
if __name__ == "__main__":
unittest.main()
5 changes: 2 additions & 3 deletions Tests/check_icns_dos.py
Expand Up @@ -6,7 +6,6 @@
from io import BytesIO

if py3:
Image.open(BytesIO(bytes('icns\x00\x00\x00\x10hang\x00\x00\x00\x00',
'latin-1')))
Image.open(BytesIO(bytes("icns\x00\x00\x00\x10hang\x00\x00\x00\x00", "latin-1")))
else:
Image.open(BytesIO(bytes('icns\x00\x00\x00\x10hang\x00\x00\x00\x00')))
Image.open(BytesIO(bytes("icns\x00\x00\x00\x10hang\x00\x00\x00\x00")))
24 changes: 13 additions & 11 deletions Tests/check_imaging_leaks.py
Expand Up @@ -9,11 +9,11 @@
max_iterations = 10000


@unittest.skipIf(sys.platform.startswith('win32'), "requires Unix or macOS")
@unittest.skipIf(sys.platform.startswith("win32"), "requires Unix or macOS")
class TestImagingLeaks(PillowTestCase):

def _get_mem_usage(self):
from resource import getpagesize, getrusage, RUSAGE_SELF

mem = getrusage(RUSAGE_SELF).ru_maxrss
return mem * getpagesize() / 1024 / 1024

Expand All @@ -25,20 +25,22 @@ def _test_leak(self, min_iterations, max_iterations, fn, *args, **kwargs):
if i < min_iterations:
mem_limit = mem + 1
continue
msg = 'memory usage limit exceeded after %d iterations' % (i + 1)
msg = "memory usage limit exceeded after %d iterations" % (i + 1)
self.assertLessEqual(mem, mem_limit, msg)

def test_leak_putdata(self):
im = Image.new('RGB', (25, 25))
self._test_leak(min_iterations, max_iterations,
im.putdata, im.getdata())
im = Image.new("RGB", (25, 25))
self._test_leak(min_iterations, max_iterations, im.putdata, im.getdata())

def test_leak_getlist(self):
im = Image.new('P', (25, 25))
self._test_leak(min_iterations, max_iterations,
# Pass a new list at each iteration.
lambda: im.point(range(256)))
im = Image.new("P", (25, 25))
self._test_leak(
min_iterations,
max_iterations,
# Pass a new list at each iteration.
lambda: im.point(range(256)),
)


if __name__ == '__main__':
if __name__ == "__main__":
unittest.main()
16 changes: 11 additions & 5 deletions Tests/check_j2k_dos.py
Expand Up @@ -6,10 +6,16 @@
from io import BytesIO

if py3:
Image.open(BytesIO(bytes(
'\x00\x00\x00\x0cjP\x20\x20\x0d\x0a\x87\x0a\x00\x00\x00\x00hang',
'latin-1')))
Image.open(
BytesIO(
bytes(
"\x00\x00\x00\x0cjP\x20\x20\x0d\x0a\x87\x0a\x00\x00\x00\x00hang",
"latin-1",
)
)
)

else:
Image.open(BytesIO(bytes(
'\x00\x00\x00\x0cjP\x20\x20\x0d\x0a\x87\x0a\x00\x00\x00\x00hang')))
Image.open(
BytesIO(bytes("\x00\x00\x00\x0cjP\x20\x20\x0d\x0a\x87\x0a\x00\x00\x00\x00hang"))
)

0 comments on commit a5208c2

Please sign in to comment.