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