Skip to content

Commit e7b802c

Browse files
committed
format
Change-Id: Ifb93c70f8ad48dce0fd0921de0e9e117819dc55c
1 parent 9fa575d commit e7b802c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

google/generativeai/types/content_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def pil_to_blob(img):
100100
mime_type = "image/gif"
101101
else:
102102
if img.mode != "RGB":
103-
img = img.convert('RGB')
103+
img = img.convert("RGB")
104104
img.save(bytesio, format="JPEG")
105105
mime_type = "image/jpeg"
106106
bytesio.seek(0)

tests/test_content.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
TEST_GIF_URL = "https://storage.googleapis.com/generativeai-downloads/data/test_img.gif"
4040
TEST_GIF_DATA = TEST_GIF_PATH.read_bytes()
4141

42+
4243
# simple test function
4344
def datetime():
4445
"Returns the current UTC date and time."
@@ -93,7 +94,7 @@ def test_jpg_to_blob(self, image):
9394

9495
@parameterized.named_parameters(
9596
["PIL", PIL.Image.open(TEST_GIF_PATH)],
96-
["P", PIL.Image.fromarray(np.zeros([6, 6, 3], dtype=np.uint8)).convert('P')],
97+
["P", PIL.Image.fromarray(np.zeros([6, 6, 3], dtype=np.uint8)).convert("P")],
9798
["IPython", IPython.display.Image(filename=TEST_GIF_PATH)],
9899
)
99100
def test_gif_to_blob(self, image):

0 commit comments

Comments
 (0)