Stop telling people the generated image is a PNG - #11
Merged
Conversation
Verified against the live API: the Gemini image models return image/jpeg by default, but every example wrote the bytes to a .png file. The MIME type comes back on each image, so the examples now take the extension from the response instead of assuming.
MarcelloDuarte
force-pushed
the
docs/refresh-model-lists
branch
from
July 31, 2026 17:25
7127343 to
d9a81f0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found by running v0.15.5 against the live API rather than a stub.
generateImage()works, but the Gemini image models returnimage/jpegby default, while every example in the README and provider docs wrote the bytes tooutput.png/image.png/edited.png. The bytes were fine, the filename was a lie, and anything dispatching on extension would have been misled.The MIME type is already returned on each image, so the examples now derive the extension from the response instead of assuming:
Live verification of v0.15.5, six checks, all passing: image returned and decodable (
image/jpeg 1408x768),aspectRatio/imageSizehonoured (2752x1536for 16:9 at 2K),numberOfImages > 1throwing,generateImageToFile()writing a valid file, chat working, andeffortmapping to a thinking level without error.Docs only, so no tag is needed.