diff --git a/src/PIL/Image.py b/src/PIL/Image.py index 6501c2355..4b088bdfd 100644 --- a/src/PIL/Image.py +++ b/src/PIL/Image.py @@ -662,7 +662,7 @@ class Image: :returns: JPEG version of the image as bytes """ try: - self._repr_image("JPEG") + return self._repr_image("JPEG") except Exception: return None