From 4ce2939b027b6787a9cea4607afb6678cb300146 Mon Sep 17 00:00:00 2001 From: homm Date: Mon, 20 Jan 2014 19:00:46 +0400 Subject: [PATCH] JpegImagePlugin._getexif expects no exif key in info dict, not None --- PIL/WebPImagePlugin.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PIL/WebPImagePlugin.py b/PIL/WebPImagePlugin.py index 90e2b540e..ab60c8dfa 100644 --- a/PIL/WebPImagePlugin.py +++ b/PIL/WebPImagePlugin.py @@ -32,8 +32,10 @@ class WebPImageFile(ImageFile.ImageFile): def _open(self): data, width, height, self.mode, icc_profile, exif = _webp.WebPDecode(self.fp.read()) - self.info["icc_profile"] = icc_profile - self.info["exif"] = exif + if icc_profile: + self.info["icc_profile"] = icc_profile + if exif: + self.info["exif"] = exif self.size = width, height self.fp = BytesIO(data)