From d7b16be284655fb427480e5badabc7a90d55178a Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Thu, 1 Dec 2022 13:49:33 -0500 Subject: [PATCH] Removed the Base64 encode as it's not required. The raw image data can be passed directly to the Image Element --- DemoPrograms/Demo_Image_From_URL.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/DemoPrograms/Demo_Image_From_URL.py b/DemoPrograms/Demo_Image_From_URL.py index ca8215fe..4999b35f 100644 --- a/DemoPrograms/Demo_Image_From_URL.py +++ b/DemoPrograms/Demo_Image_From_URL.py @@ -1,6 +1,5 @@ import PySimpleGUI as sg import urllib.request -import base64 """ Display an Image Located at a URL @@ -19,7 +18,7 @@ import base64 image_URL = r'https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png' -layout = [[sg.Image(base64.b64encode(urllib.request.urlopen(image_URL).read()))]] +layout = [[sg.Image(urllib.request.urlopen(image_URL).read())]] window = sg.Window('Image From URL', layout)