diff --git a/google/generativeai/types/content_types.py b/google/generativeai/types/content_types.py index 82d36f7c5..e2e2b680d 100644 --- a/google/generativeai/types/content_types.py +++ b/google/generativeai/types/content_types.py @@ -30,6 +30,7 @@ if typing.TYPE_CHECKING: import PIL.Image + import PIL.PngImagePlugin import IPython.display IMAGE_TYPES = (PIL.Image.Image, IPython.display.Image) @@ -37,6 +38,7 @@ IMAGE_TYPES = () try: import PIL.Image + import PIL.PngImagePlugin IMAGE_TYPES = IMAGE_TYPES + (PIL.Image.Image,) except ImportError: