Skip to content

Expand PIL image support. #523

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Aug 27, 2024
Merged

Conversation

MarkDaoust
Copy link
Collaborator

@MarkDaoust MarkDaoust commented Aug 23, 2024

This solves most of it by basically noticing that if an image is created from a file -> turn it back to that file type.

But if it's not created from a file, is it okay to just covert to RGB, or can we do better?

Fixes:#511

Change-Id: I7303becbbd6a9441c406a28e84ecc86d2fdd35bd
@MarkDaoust MarkDaoust marked this pull request as draft August 23, 2024 18:39
@github-actions github-actions bot added status:awaiting review PR awaiting review from a maintainer component:python sdk Issue/PR related to Python SDK labels Aug 23, 2024
Change-Id: Ibc8e091c63d30626f78510156e8c024014dddcca
Change-Id: I49b9ab206ade37a8a5535b21fa7fdf62a0c569d2
Change-Id: I813e8569b91e01a0884b1c2ff75dfa84fcf4a609
@MarkDaoust MarkDaoust changed the title fixes#511 Expand PIL image support (fixes#511) Aug 23, 2024
Change-Id: I1e4a62bb1e1fade244771027380b8a13f444885d
@MarkDaoust MarkDaoust marked this pull request as ready for review August 23, 2024 21:55
Change-Id: Ifb93c70f8ad48dce0fd0921de0e9e117819dc55c
@MarkDaoust MarkDaoust changed the title Expand PIL image support (fixes#511) Expand PIL image support. Aug 24, 2024
@MarkDaoust MarkDaoust requested a review from markmcd August 26, 2024 18:59
else:
if img.mode != "RGB":
img = img.convert('RGB')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect this will upset black

markmcd
markmcd previously approved these changes Aug 27, 2024
Copy link
Member

@markmcd markmcd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strategy for converting LGTM. Seems straightforward to update if we discover new corner cases.

@MarkDaoust MarkDaoust merged commit e805b24 into google-gemini:main Aug 27, 2024
9 checks passed
@github-actions github-actions bot removed the status:awaiting review PR awaiting review from a maintainer label Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:python sdk Issue/PR related to Python SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants