-
Notifications
You must be signed in to change notification settings - Fork 110
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Description
Description
When an SVG file is uploaded and used in a generation, the system throws an error:
UnknownError: Unsupported MIME type: image/svg+xml
Root Cause
In packages/giselle/src/generations/internal/use-generation-executor.ts:570, image/svg+xml is treated as an ImagePart and sent to the LLM provider. However, none of the major LLM providers support SVG format for vision/image input.
Supported Image Formats by Provider
| Provider | Supported Formats | SVG Support |
|---|---|---|
| OpenAI | JPEG, PNG, GIF, WebP | Not supported |
| Anthropic (Claude) | JPEG, PNG, GIF, WebP | Not supported |
| Google (Gemini) | JPEG, PNG, WebP, HEIC, HEIF | Not supported |
References
Proposed Solutions
- Remove SVG from ImagePart handling - Treat SVG as unsupported and log a warning (simplest)
- Convert SVG to raster format - Server-side conversion to PNG before sending to LLM
- Treat SVG as text - Since SVG is XML, it could potentially be sent as text content
Current Code
switch (fileParameter.type) {
case "image/jpeg":
case "image/png":
case "image/gif":
case "image/svg+xml": // <- This should not be treated as ImagePart
return {
type: "image",
image: blob,
} as ImagePart;Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed