Commit Graph

259 Commits

Author SHA1 Message Date
Hugo van Kemenade
a7f384a813
Merge pull request #4292 from radarhere/private_png_chunks
Added reading and writing of private PNG chunks
2020-10-05 23:49:09 +03:00
nulano
d22608b7bd fix hyphens and add missing articles
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2020-10-04 20:12:47 +01:00
nulano
a9b8dcba7d write anchor docs
(cherry picked from commit dcaee36941e6cb5e6f93186b6f819fb74887e0d3)
2020-09-22 14:58:17 +02:00
MauveRanger
96b3935adc
[ci skip] Clarify that modes are strings, not constants
I misunderstood this section the first time I read it. I hope this change will clarify how to request a mode such as from Image.new("RGBA", size)
2020-09-09 18:28:49 -04:00
Hugo van Kemenade
e0eec1eb56 Merge branch 'master' into rm-3.5 2020-09-01 20:16:46 +03:00
Hugo van Kemenade
10615a7da7 Upgrade Python syntax for 3.6+
Co-authored-by: nulano <nulano@nulano.eu>
2020-07-30 10:09:18 +03:00
Andrew Murray
836dcc5ba0 Document missing attributes 2020-07-23 22:40:02 +10:00
Andrew Murray
45564fe89d Removed domain references when referring to hypothetical code 2020-07-14 22:36:46 +10:00
Andrew Murray
cd10404abb Corrected reference 2020-07-14 22:36:36 +10:00
Hugo van Kemenade
4ca7e7e699
Merge pull request #4771 from nulano/refs-misc 2020-07-11 12:42:50 +03:00
nulano
39b5d7b4ac fix TiffTags and Exif related references 2020-07-11 13:25:10 +10:00
nulano
0083ebb3d4 fix various reference typos 2020-07-11 13:25:10 +10:00
nulano
9c277f5c49 document PngImagePlugin constants 2020-07-11 13:23:19 +10:00
Hugo van Kemenade
fc1f16b616
Merge pull request #4774 from nulano/refs-std 2020-07-10 17:45:04 +03:00
Hugo van Kemenade
384523fab2 Fix PostScript typos 2020-07-10 11:48:02 +03:00
nulano
9589159585 use cross-reference for None value 2020-07-10 00:08:27 +02:00
Hugo van Kemenade
109c637ddb 'plugin', formatting and typos 2020-07-03 09:38:30 +03:00
nulano
9019af5f32
Merge branch 'master' into refs-const 2020-06-28 10:55:26 +01:00
nulano
19dd5cbfab fix some function references
(cherry picked from commit 9fb582940d)
2020-06-27 15:40:37 +02:00
nulano
3342270947 fix Image constants references
(cherry picked from commit 5511111f3b)
2020-06-27 15:39:55 +02:00
Andrew Murray
3b62151215 Changed example function name to match use in code [ci skip] 2020-05-17 16:05:54 +10:00
Andrew Murray
67d26ed051 Use _accept function in example plugin [ci skip] 2020-05-17 09:24:06 +10:00
Hugo
94c7af7596 Replace spaces with tabs and add to pre-commit linting 2020-05-01 21:23:39 +03:00
Hugo
dda6145fce Since Python 3.3 IOError and WindowsError have been merged into OSError 2020-04-10 12:57:29 +03:00
Andrew Murray
e2437c9b48 Corrected description [ci skip] 2020-04-06 21:57:45 +10:00
Andrew Murray
9f61be4c72
Merge branch 'master' into apng 2020-03-09 23:29:40 +11:00
Andrew Murray
e41cfade29 Add JPEG comment to info dictionary 2020-03-07 06:57:29 +11:00
Hugo van Kemenade
0f7ed2d35f
Merge pull request #4435 from radarhere/close_images
Close exclusively opened images
2020-03-06 00:27:46 +02:00
Hugo van Kemenade
64a9e0c660
Merge branch 'master' into apng 2020-02-29 17:40:17 +02:00
Andrew Murray
04f7c75466 Use context manager when opening images [ci skip] 2020-02-29 10:29:44 +11:00
Peter Rowlands
9b72f0513c Adjust is_animated behavior
- Make is_animated APNG behavior consistent with other Pillow formats
- is_animated will be true when n_frames is greater than 1 (for APNG
  this depends on animation frame count + presence or absence of a
  default image)
2020-02-23 15:14:06 +11:00
Peter Rowlands
dcc3f41fa1 Add release notes 2020-02-23 15:14:06 +11:00
Peter Rowlands
3a254701f6 Cleanup documentation
- Add changes requested by hugovk
2020-02-23 15:14:06 +11:00
Peter Rowlands (변기호)
0b536fb599 fix documentation review issue
[ci skip]

Co-Authored-By: Andrew Murray <3112309+radarhere@users.noreply.github.com>
2020-02-23 15:14:06 +11:00
Peter Rowlands
916b2e1b74 Document APNG support 2020-02-23 15:14:06 +11:00
Andrew Murray
a8c0794107 Allow saving of zero quality JPEG images 2020-02-21 22:05:44 +11:00
Andrew Murray
8e7010d9ae Changed example plugin to work in Python 3 [ci skip] 2020-02-09 15:34:14 +11:00
Andrew Murray
db970acfa5 Grammar fix [ci skip] 2020-02-06 20:10:34 +11:00
Andrew Murray
1f58028173 Use BytesIO instead of StringIO [ci skip] 2020-01-21 23:21:57 +11:00
Andrew Murray
feec1bbcb2 Updated WMF documentation [ci skip] 2019-12-30 10:12:37 +11:00
Hugo
7b4ae104f0 Fix malformed table 2019-12-16 15:07:56 +02:00
Hugo
cc63f66575 Merge remote-tracking branch 'upstream/master' into rm-2.7 2019-11-01 13:22:56 +02:00
Jon Dufresne
4cd4adddc3 Improve handling of file resources
Follow Python's file object semantics. User code is responsible for
closing resources (usually through a context manager) in a deterministic
way.

To achieve this, remove __del__ functions. These functions used to
closed open file handlers in an attempt to silence Python
ResourceWarnings. However, using __del__ has the following drawbacks:

- __del__ isn't called until the object's reference count reaches 0.
  Therefore, resource handlers remain open or in use longer than
  necessary.

- The __del__ method isn't guaranteed to execute on system exit. See the
  Python documentation:

  https://docs.python.org/3/reference/datamodel.html#object.__del__

  > It is not guaranteed that __del__() methods are called for objects
  > that still exist when the interpreter exits.

- Exceptions that occur inside __del__ are ignored instead of raised.
  This has the potential of hiding bugs. This is also in the Python
  documentation:

  > Warning: Due to the precarious circumstances under which __del__()
  > methods are invoked, exceptions that occur during their execution
  > are ignored, and a warning is printed to sys.stderr instead.

Instead, always close resource handlers when they are no longer in use.
This will close the file handler at a specified point in the user's code
and not wait until the interpreter chooses to. It is always guaranteed
to run. And, if an exception occurs while closing the file handler, the
bug will not be ignored.

Now, when code receives a ResourceWarning, it will highlight an area
that is mishandling resources. It should not simply be silenced, but
fixed by closing resources with a context manager.

All warnings that were emitted during tests have been cleaned up. To
enable warnings, I passed the `-Wa` CLI option to Python. This exposed
some mishandling of resources in ImageFile.__init__() and
SpiderImagePlugin.loadImageSeries(), they too were fixed.
2019-10-12 08:27:17 -07:00
Andrew Murray
4140cd807b
Merge branch 'master' into rm-2.7 2019-10-12 18:03:58 +11:00
Andrew Murray
a8c07e3d5f Added orientation note [ci skip] 2019-10-11 22:40:31 +11:00
Hugo
0caa48b179 Remove redundant __future__ from docs
Co-Authored-By: Jon Dufresne <jon.dufresne@gmail.com>
2019-10-08 17:26:11 +03:00
Andrew Murray
ecb3a30487 Clarified documentation [ci skip] 2019-10-06 13:52:58 +11:00
Hugo
f792ab6c02 RST uses double backticks for code (MD uses 1) 2019-09-13 08:56:33 +03:00
Andrew Murray
5ad5be4a32 Reference Pillow not PIL [ci skip] 2019-09-06 06:13:12 +10:00
Andrew Murray
51457311de
Reference Pillow not PIL [ci skip]
Co-Authored-By: Hugo van Kemenade <hugovk@users.noreply.github.com>
2019-09-06 06:10:40 +10:00