-
Notifications
You must be signed in to change notification settings - Fork 456
Automatic image blob creation doesn't handle P images with JPEG #511
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
Comments
I tried to run your code on Colab and faced the same issue Please find the gist here for reference. Thanks! |
You leaked your API key, just letting you know. |
Ah, I see, thanks for reporting. It looks like my first fix was junk. It looks like I can probably use |
@BluePigman @manojssmk please have a look at the fix in #523 and LMK if you have any feedback. |
Looks good to me! |
Fixed. |
Description of the bug:
Currently P mode images cannot be uploaded to Gemini. https://pillow.readthedocs.io/en/stable/handbook/concepts.html#modes
Actual vs expected behavior:
Actual:
Running this code gives the errors:
KeyError: 'P'
OSError: cannot write mode P as JPEG
Expected:
If we add the following line before generating the response
The code runs with no errors.
Any other information you'd like to share?
This is similar to this issue solved previously: #160
The text was updated successfully, but these errors were encountered: