mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-24 00:04:09 +03:00
Apply suggestions from code review
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
This commit is contained in:
parent
126bc44e9e
commit
f47633a24a
|
@ -391,8 +391,8 @@ if __name__ == "__main__":
|
|||
with open(sys.argv[1], "rb") as fp:
|
||||
imf = IcnsImageFile(fp)
|
||||
for size in imf.info["sizes"]:
|
||||
w, h, x = imf.size = size
|
||||
imf.save(f"out-{w}-{h}-{x}.png")
|
||||
width, height, scale = imf.size = size
|
||||
imf.save(f"out-{width}-{height}-{scale}.png")
|
||||
with Image.open(sys.argv[1]) as im:
|
||||
im.save("out.png")
|
||||
if sys.platform == "windows":
|
||||
|
|
|
@ -3100,8 +3100,8 @@ def fromarray(obj, mode=None):
|
|||
try:
|
||||
mode, rawmode = _fromarray_typemap[typekey]
|
||||
except KeyError as e:
|
||||
typ_shape, typ_type = typekey
|
||||
msg = f"Cannot handle this data type: {typ_shape}, {typ_type}"
|
||||
typekey_shape, typestr = typekey
|
||||
msg = f"Cannot handle this data type: {typekey_shape}, {typestr}"
|
||||
raise TypeError(msg) from e
|
||||
else:
|
||||
rawmode = mode
|
||||
|
|
Loading…
Reference in New Issue
Block a user