From eda3fc3c912c066c18231e73dd4fc885e8975cd5 Mon Sep 17 00:00:00 2001 From: Kevin Postal Date: Sat, 3 Dec 2011 20:04:06 -0800 Subject: [PATCH] Catch KeyError on image.info dictionary --- imagekit/processors/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/imagekit/processors/__init__.py b/imagekit/processors/__init__.py index db269fa..072138e 100644 --- a/imagekit/processors/__init__.py +++ b/imagekit/processors/__init__.py @@ -227,7 +227,10 @@ class AutoConvert(object): matte = True elif img.mode == 'P': if self.format in PALETTE_TRANSPARENCY_FORMATS: - self.save_kwargs['transparency'] = img.info['transparency'] + try: + self.save_kwargs['transparency'] = img.info['transparency'] + except KeyError: + pass elif self.format in RGBA_TRANSPARENCY_FORMATS: # Currently PIL doesn't support any RGBA-mode formats that # aren't also P-mode formats, so this will never happen.