fix: use Gemini API supported image formats for clipboard#14762
fix: use Gemini API supported image formats for clipboard#14762jackwotherspoon merged 4 commits intomainfrom
Conversation
Summary of ChangesHello @jackwotherspoon, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refines the application's clipboard image handling to strictly adhere to the image formats supported by the Gemini API. By removing unsupported formats and centralizing the definition of acceptable extensions, the change aims to prevent potential compatibility issues and streamline image processing for API interactions. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request updates clipboard image handling to align with formats supported by the Gemini API. The changes correctly remove unsupported formats (TIFF, GIF) and refactor the cleanup logic to use a new shared constant for image extensions. My review highlights two main points: a misleading comment in saveClipboardImage that lists formats not actually handled, and a change in cleanupOldClipboardImages that stops it from cleaning up legacy format files, which could lead to orphaned files.
|
Size Change: -11 B (0%) Total Size: 21.6 MB ℹ️ View Unchanged
|
Summary
Updates clipboard image handling to only use formats supported by the Gemini API.
Changes:
IMAGE_EXTENSIONSconstant for reuse across clipboard utilitiescleanupOldClipboardImagesto use the shared constantSupported formats: PNG, JPEG, WEBP, HEIC, HEIF
Reference: https://ai.google.dev/gemini-api/docs/image-understanding#supported-formats
Related Issues
Part 1 of breaking up #14706 into smaller chunks
How to Validate
Pre-Merge Checklist