diff --git a/DemoPrograms/Demo_Emoji_Toolbar_PIL.py b/DemoPrograms/Demo_Emoji_Toolbar_PIL.py index ee4b84b5..dd0cecee 100644 --- a/DemoPrograms/Demo_Emoji_Toolbar_PIL.py +++ b/DemoPrograms/Demo_Emoji_Toolbar_PIL.py @@ -92,7 +92,7 @@ def convert_to_bytes(file_or_bytes, resize=None, fill=False): if resize: new_width, new_height = resize scale = min(new_height / cur_height, new_width / cur_width) - img = img.resize((int(cur_width * scale), int(cur_height * scale)), PIL. Image.LANCZOS) + img = img.resize((int(cur_width * scale), int(cur_height * scale)), PIL.Image.LANCZOS) if fill: if resize is not None: img = make_square(img, resize[0]) diff --git a/DemoPrograms/Demo_Graph_Elem_Image_Album.py b/DemoPrograms/Demo_Graph_Elem_Image_Album.py index 90f2770e..4a38454f 100644 --- a/DemoPrograms/Demo_Graph_Elem_Image_Album.py +++ b/DemoPrograms/Demo_Graph_Elem_Image_Album.py @@ -44,7 +44,7 @@ def convert_to_bytes(file_or_bytes, resize=None): if resize: new_width, new_height = resize scale = min(new_height/cur_height, new_width/cur_width) - img = img.resize((int(cur_width*scale), int(cur_height*scale)), PIL. Image.LANCZOS) + img = img.resize((int(cur_width*scale), int(cur_height*scale)), PIL.Image.LANCZOS) bio = io.BytesIO() img.save(bio, format="PNG") del img diff --git a/DemoPrograms/Demo_Image_Elem_Image_Viewer_PIL_Based.py b/DemoPrograms/Demo_Image_Elem_Image_Viewer_PIL_Based.py index 9cb05b8c..9585b96c 100644 --- a/DemoPrograms/Demo_Image_Elem_Image_Viewer_PIL_Based.py +++ b/DemoPrograms/Demo_Image_Elem_Image_Viewer_PIL_Based.py @@ -45,7 +45,7 @@ def convert_to_bytes(file_or_bytes, resize=None): if resize: new_width, new_height = resize scale = min(new_height/cur_height, new_width/cur_width) - img = img.resize((int(cur_width*scale), int(cur_height*scale)), PIL. Image.LANCZOS) + img = img.resize((int(cur_width*scale), int(cur_height*scale)), PIL.Image.LANCZOS) with io.BytesIO() as bio: img.save(bio, format="PNG") del img diff --git a/DemoPrograms/Demo_Image_Viewer_Thumbnails.py b/DemoPrograms/Demo_Image_Viewer_Thumbnails.py index 43742cc8..d7f77498 100644 --- a/DemoPrograms/Demo_Image_Viewer_Thumbnails.py +++ b/DemoPrograms/Demo_Image_Viewer_Thumbnails.py @@ -56,7 +56,7 @@ def convert_to_bytes(file_or_bytes, resize=None, fill=False): if resize: new_width, new_height = resize scale = min(new_height / cur_height, new_width / cur_width) - img = img.resize((int(cur_width * scale), int(cur_height * scale)), PIL. Image.LANCZOS) + img = img.resize((int(cur_width * scale), int(cur_height * scale)), PIL.Image.LANCZOS) if fill: img = make_square(img, THUMBNAIL_SIZE[0]) with io.BytesIO() as bio: diff --git a/DemoPrograms/Demo_Matplotlib_Grid_of_Graphs_Using_PIL.py b/DemoPrograms/Demo_Matplotlib_Grid_of_Graphs_Using_PIL.py index fb253de3..09097450 100644 --- a/DemoPrograms/Demo_Matplotlib_Grid_of_Graphs_Using_PIL.py +++ b/DemoPrograms/Demo_Matplotlib_Grid_of_Graphs_Using_PIL.py @@ -890,7 +890,7 @@ def convert_to_bytes(file_or_bytes, resize=None): if resize: new_width, new_height = resize scale = min(new_height/cur_height, new_width/cur_width) - img = img.resize((int(cur_width*scale), int(cur_height*scale)), PIL. Image.LANCZOS) + img = img.resize((int(cur_width*scale), int(cur_height*scale)), PIL.Image.LANCZOS) with io.BytesIO() as bio: img.save(bio, format="PNG") del img diff --git a/DemoPrograms/Demo_PNG_Thumbnail_Viewer.py b/DemoPrograms/Demo_PNG_Thumbnail_Viewer.py index 3056c3ad..9b400da0 100644 --- a/DemoPrograms/Demo_PNG_Thumbnail_Viewer.py +++ b/DemoPrograms/Demo_PNG_Thumbnail_Viewer.py @@ -59,7 +59,7 @@ def convert_to_bytes(file_or_bytes, resize=None): if resize: new_width, new_height = resize scale = min(new_height / cur_height, new_width / cur_width) - img = img.resize((int(cur_width * scale), int(cur_height * scale)), PIL. Image.LANCZOS) + img = img.resize((int(cur_width * scale), int(cur_height * scale)), PIL.Image.LANCZOS) with io.BytesIO() as bio: img.save(bio, format="PNG") del img @@ -80,7 +80,7 @@ def convert_to_bytes(file_or_bytes, resize=None): def set_image_to_blank(key): img = PIL.Image.new('RGB', (100, 100), (255, 255, 255)) - img.thumbnail((1, 1), PIL. Image.LANCZOS) + img.thumbnail((1, 1), PIL.Image.LANCZOS) bio = io.BytesIO() img.save(bio, format='PNG') imgbytes = bio.getvalue() diff --git a/docs/cookbook.md b/docs/cookbook.md index cc8789b6..5a2b26a2 100644 --- a/docs/cookbook.md +++ b/docs/cookbook.md @@ -2664,7 +2664,7 @@ def convert_to_bytes(file_or_bytes, resize=None): if resize: new_width, new_height = resize scale = min(new_height/cur_height, new_width/cur_width) - img = img.resize((int(cur_width*scale), int(cur_height*scale)), PIL. Image.LANCZOS) + img = img.resize((int(cur_width*scale), int(cur_height*scale)), PIL.Image.LANCZOS) bio = io.BytesIO() img.save(bio, format="PNG") del img @@ -2747,7 +2747,7 @@ def convert_to_bytes(file_or_bytes, resize=None): if resize: new_width, new_height = resize scale = min(new_height/cur_height, new_width/cur_width) - img = img.resize((int(cur_width*scale), int(cur_height*scale)), PIL. Image.LANCZOS) + img = img.resize((int(cur_width*scale), int(cur_height*scale)), PIL.Image.LANCZOS) bio = io.BytesIO() img.save(bio, format="PNG") del img