From 3f5ad37cad9b577757a4d64c57f7de72070c3d28 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Sat, 25 Jan 2025 07:58:52 +0530 Subject: [PATCH] Fix #58: Option to raise pixel limit --- README.md | 6 ++++++ imgp | 2 ++ 2 files changed, 8 insertions(+) diff --git a/README.md b/README.md index 0c69ccb..72ff746 100644 --- a/README.md +++ b/README.md @@ -251,6 +251,12 @@ optional arguments: imgp -acx 64x64 "$pop" } +### Troubleshooting + +1. To lift the pixel limit (e.g. error `'PIL.Image.DecompressionBombError' when resizing large image`) for _trusted_ input files, uncomment the following line in the source code: + + Image.MAX_IMAGE_PIXELS = None + ### Developers 1. Copyright © 2016-2025 [Arun Prakash Jana](https://github.com/jarun) diff --git a/imgp b/imgp index 26ff29f..6585dfe 100755 --- a/imgp +++ b/imgp @@ -27,6 +27,8 @@ import math import PIL from PIL import Image, ImageFile +#Image.MAX_IMAGE_PIXELS = None + if not hasattr(PIL.Image, 'Resampling'): # Pillow<9.0 PIL.Image.Resampling = PIL.Image