Commit 9fb0792
committed
Remove use of deprecated Pillow function
Fixes #170 by removing use of `PIL.Image.getdata()`.
Rather than using the suggested replacement of `get_flattened_data` which would,
require checking the version of Pillow, this uses `PIL.Image.tobytes()`,
which is available on all versions of Pillow.
`.tobytes` is also significantly faster, as it doesn't require Python list
iteration. Since the image is explicitly converted to "RGBA" format, the
bytes representation is just a linear list of the pixel values anyway.1 parent ad7522c commit 9fb0792
2 files changed
Lines changed: 2 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
| 82 | + | |
88 | 83 | | |
89 | 84 | | |
90 | 85 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
0 commit comments