From 844ed441deb6b75d3048fa111977188ed47f0b76 Mon Sep 17 00:00:00 2001 From: wiredfool Date: Mon, 7 Apr 2014 15:59:33 -0700 Subject: [PATCH] Add the suffix if it's not there, not if it is --- PIL/Image.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PIL/Image.py b/PIL/Image.py index 54c68e2dc..40a467d12 100644 --- a/PIL/Image.py +++ b/PIL/Image.py @@ -513,7 +513,7 @@ class Image: if not format or format == "PPM": self.im.save_ppm(file) else: - if file.endswith(format): + if not file.endswith(format): file = file + "." + format self.save(file, format) return file