mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-03 21:24:31 +03:00
Merge pull request #6821 from radarhere/pyaccess
This commit is contained in:
commit
6fc0456688
|
@ -71,6 +71,19 @@ def test_save_to_bytes():
|
|||
)
|
||||
|
||||
|
||||
def test_getpixel(tmp_path):
|
||||
temp_file = str(tmp_path / "temp.ico")
|
||||
|
||||
im = hopper()
|
||||
im.save(temp_file, "ico", sizes=[(32, 32), (64, 64)])
|
||||
|
||||
with Image.open(temp_file) as reloaded:
|
||||
reloaded.load()
|
||||
reloaded.size = (32, 32)
|
||||
|
||||
assert reloaded.getpixel((0, 0)) == (18, 20, 62)
|
||||
|
||||
|
||||
def test_no_duplicates(tmp_path):
|
||||
temp_file = str(tmp_path / "temp.ico")
|
||||
temp_file2 = str(tmp_path / "temp2.ico")
|
||||
|
|
|
@ -327,6 +327,7 @@ class IcoImageFile(ImageFile.ImageFile):
|
|||
# if tile is PNG, it won't really be loaded yet
|
||||
im.load()
|
||||
self.im = im.im
|
||||
self.pyaccess = None
|
||||
self.mode = im.mode
|
||||
if im.size != self.size:
|
||||
warnings.warn("Image was not the expected size")
|
||||
|
|
Loading…
Reference in New Issue
Block a user