From f2ba805e6c37225af45e1613f6a183fbd697f77c Mon Sep 17 00:00:00 2001 From: Liam <101684827+SkiingIsFun123@users.noreply.github.com> Date: Mon, 26 Sep 2022 11:25:52 -0700 Subject: [PATCH] Update decode.py --- decode.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/decode.py b/decode.py index a9993c7..e6b608c 100644 --- a/decode.py +++ b/decode.py @@ -2,13 +2,6 @@ import os from PIL import Image -file_name = input("Enter the name of the file including the extension: ") -file_type = file_name.split('.')[1] -if file_type == "png": - decodeImage() -else: - print('Error') - def decodeImage(): image = Image.open(image_name) pixels = image.load() @@ -43,3 +36,10 @@ def decodeImage(): break decoded_data = decoded_data[:-10] print(decoded_data) + +file_name = input("Enter the name of the file including the extension: ") +file_type = file_name.split('.')[1] +if file_type == "png": + decodeImage() +else: + print('Error')