From 803f704616b21d29faeb6de0adb31717f58e7d43 Mon Sep 17 00:00:00 2001 From: Sam Welter Date: Tue, 5 Mar 2019 22:17:05 -0600 Subject: [PATCH] Suppressed PIL's error warning of extremely large images potentially being a dos attack. --- solve.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/solve.py b/solve.py index 321b081..069261b 100644 --- a/solve.py +++ b/solve.py @@ -8,7 +8,10 @@ def solve(factory, method, input_file, output_file): # Load Image - print ("Loading Image") + + # Set this flag for extremely large mazes, as PIL thinks they are a decompression DOS attack, and PIL will throw an error. This suppresses that error. + Image.MAX_IMAGE_PIXELS = None + im = Image.open(input_file) # Create the maze (and time it) - for many mazes this is more time consuming than solving the maze