mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-20 12:14:46 +03:00
Document ImageFile.MAXBLOCK (#9163)
This commit is contained in:
commit
dabeb689c9
|
@ -74,5 +74,6 @@ Constants
|
|||
---------
|
||||
|
||||
.. autodata:: PIL.ImageFile.LOAD_TRUNCATED_IMAGES
|
||||
.. autodata:: PIL.ImageFile.MAXBLOCK
|
||||
.. autodata:: PIL.ImageFile.ERRORS
|
||||
:annotation:
|
||||
|
|
|
@ -46,6 +46,18 @@ if TYPE_CHECKING:
|
|||
logger = logging.getLogger(__name__)
|
||||
|
||||
MAXBLOCK = 65536
|
||||
"""
|
||||
By default, Pillow processes image data in blocks. This helps to prevent excessive use
|
||||
of resources. Codecs may disable this behaviour with ``_pulls_fd`` or ``_pushes_fd``.
|
||||
|
||||
When reading an image, this is the number of bytes to read at once.
|
||||
|
||||
When writing an image, this is the number of bytes to write at once.
|
||||
If the image width times 4 is greater, then that will be used instead.
|
||||
Plugins may also set a greater number.
|
||||
|
||||
User code may set this to another number.
|
||||
"""
|
||||
|
||||
SAFEBLOCK = 1024 * 1024
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user