Commit Graph

103 Commits

Author SHA1 Message Date
Andrew Murray
7972332bc5 Added type hints 2024-01-17 19:22:45 +11:00
pre-commit-ci[bot]
edaf7acdb3 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-01-15 22:01:19 +00:00
Andrew Murray
6a2bdb6feb Added type hints 2024-01-16 09:00:40 +11:00
Andrew Murray
c75a93b9a3 Added type hints 2024-01-15 16:11:48 +11:00
Nulano
cc51dace35 fix types hints for ImageFile._Tile 2023-12-27 14:55:30 +01:00
Hugo van Kemenade
dd42a24f9e
Merge pull request #7565 from radarhere/tile 2023-12-21 12:59:28 +02:00
Benjamin Gilbert
e1fb1ab5c4 Deprecate raise_oserror() for removal in Pillow 12
It's only useful if the caller has an IMAGING_CODEC_* error code, which
are only produced by codec decode() methods and are automatically
translated by ImageFile.

Co-authored-by: Andrew Murray <radarhere@users.noreply.github.com>
2023-12-13 02:17:32 -06:00
Benjamin Gilbert
ec17dc11ba Translate encoder error codes to strings
When decoding, we use raise_oserror() to convert codec error codes to
strings.  Adapt that code to be used when encoding as well.  Add a new
helper function that returns the exception so we can still raise
`from exc`.
2023-12-12 23:13:51 -06:00
Andrew Murray
5aadeb5004 Moved _Tile to ImageFile 2023-12-02 21:36:17 +11:00
Andrew Murray
49578f0059
Merge branch 'main' into improved_dds 2023-12-02 21:35:20 +11:00
Andrew Murray
a07bac3a56 Attempt memory mapping when tile args is a string 2023-11-21 21:45:14 +11:00
Aarni Koskela
0c705692ea Remove old commented-out code 2023-11-06 21:21:07 +02:00
Andrew Murray
a54d28a7bc Merge branch 'main' into improved_dds 2023-10-21 14:27:31 +11:00
Andrew Murray
8b71f3d3c1 Added messages to errors 2023-10-19 18:42:41 +11:00
Andrew Murray
5e9a2e3000 Renamed "tile_args" to "args" for consistency with existing ImageFile variable 2023-10-17 19:10:24 +11:00
REDxEYE
a5dde8b1c4 Apply suggestion for PR 2023-10-12 19:09:28 +03:00
pre-commit-ci[bot]
777c54a4d1 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-06-15 00:09:03 +00:00
REDxEYE
9165771d5e Add BC5U support. Seen in Amnesia: The Bunker 2023-06-15 03:08:04 +03:00
pre-commit-ci[bot]
3602e35818 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-06-15 02:37:36 +03:00
REDxEYE
de2b4be9b9 Add Tile namedtuple for code readability.
Add typing info to Image.tile
2023-06-15 02:30:31 +03:00
Andrew Murray
fcc59a4001 Use existing variable names from ImageFile 2023-02-25 16:31:26 +02:00
Aarni Koskela
04be46d484 Clarify variable names in ImageFile
Co-authored-by: Yay295 <Yay295@users.noreply.github.com>
2023-02-24 10:04:38 +02:00
pre-commit-ci[bot]
24183d652e [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-02-06 19:27:19 +00:00
Andrew Murray
68fdd2a9e7 Further improve exception traceback readability 2022-12-30 14:24:28 +11:00
Hugo van Kemenade
2ae55ccbda Improve exception traceback readability 2022-12-30 00:07:52 +02:00
Andrew Murray
4f0b83cc54 Only set tile in ImageFile __setstate__ 2022-12-09 12:29:27 +11:00
Andrew Murray
c463ef4fe3 Fallback to not using mmap if buffer is not large enough 2022-08-17 21:13:09 +10:00
Andrew Murray
8784ee1410 Moved code into separate function 2022-07-22 07:59:30 +10:00
Andrew Murray
886fcbe3d6 Do not open images with zero or negative height 2022-05-04 21:25:40 +10:00
Andrew Murray
bcded33cee
Merge pull request #6195 from hugovk/cleanup
Cleanup: various
2022-04-26 18:51:44 +10:00
Hugo van Kemenade
d241e38120 [Private] function names should be snake_case 2022-04-10 23:55:16 +03:00
Hugo van Kemenade
ee85e387ba Remove redundant parentheses 2022-04-10 23:39:54 +03:00
Andrew Murray
e87432b745 First return value is unused 2022-03-08 19:51:24 +11:00
Andrew Murray
54a4a38e42 Return -1 when finished decoding 2022-03-08 19:48:58 +11:00
Andrew Murray
397a940995
Merge pull request #6094 from radarhere/decoder
Improved codec documentation
2022-03-07 08:01:31 +11:00
Hugo van Kemenade
c16737d589
Merge pull request #6096 from radarhere/cleanup 2022-03-06 20:12:13 +02:00
Andrew Murray
95e3194497 Improved documentation for _pulls_fd and _pushes_fd 2022-03-01 13:15:12 +11:00
Andrew Murray
bb9338e34d Removed duplicate code 2022-02-28 14:13:04 +11:00
Andrew Murray
4d868abd8a Moved non-codec code outside of try block 2022-02-28 14:13:04 +11:00
Andrew Murray
a606fd85a3 Run encoder cleanup method after errors as well 2022-02-28 14:12:56 +11:00
Andrew Murray
f2987d65c0 Linked to file codec documentation 2022-02-28 08:36:26 +11:00
Andrew Murray
a0e1fde1ed Added PyEncoder 2022-02-25 16:07:01 +11:00
Andrew Murray
fb7edfda68 Improved consistency of returning an image access object from load() 2022-02-02 11:49:31 +11:00
Andrew Murray
7370a0b1cf Remove consecutive duplicates that only differ by their offset 2022-01-01 14:54:23 +11:00
Andrew Murray
5c05fe4d9b Fixed raising OSError in _safe_read when size is greater than SAFEBLOCK 2021-12-07 11:40:44 +11:00
Andrew Murray
ab6efcb925
Merge pull request #5665 from infmagic2047/master
Do not return in ImageFile when saving to stdout
2021-11-26 00:12:40 +11:00
Andrew Murray
83864b01cf Removed Image.show command parameter 2021-10-18 11:08:51 +11:00
Andrew Murray
e444e7ab6d Removed ImageFile.raise_ioerror 2021-10-18 11:06:02 +11:00
Yutao Yuan
f55ccd9563 Remove stdout check in ImageFile._save 2021-08-09 23:13:54 +08:00
Andrew Murray
f962b18f69 Catch OSError when checking if fp is sys.stdout 2021-07-06 11:00:03 +10:00