Welcome to Portkey Forum

Updated 5 months ago

"invalid image" errors

At a glance
Folks, I am facing a wierd issue. Both gpt-4o and claude 3.5-sonnet are giving me "invalid image" errors. But the images are fine. png, 40-50 kb in size.
Even more wierd, it is happening consistently for 1 user. While for others its fine.
V
v
V
19 comments
non working image:
Attachment
46hVPDvQzpwQ9TcLPCAXGfvcvLWYQQQsgAT9hdcRJqXPvJgAAAABJRU5ErkJggg.png
working image
Attachment
3yUBTdXDVngAAAABJRU5ErkJggg.png
You would be converting the images to base64 and then sending it in the request. Can you please verify if the b64 string is fine by comparing them with each other (mostly the mediaType). It should ideally be something like:
Plain Text
data:image/png;base64,someRandomBlob....


This might happen if the mediaType is incorrect in the b64 string.
Yeah that seems to be correct. The url is opening in chrome, and the image is loading in the portkey logs
@vedu this solved the issue right?
No I meant the url is correct but still getting the llm errors
@vedu i downloaded both the images you shared, and strangely - the LLM is always hallucinating on the first (non-working) image, while correctly viewing the second (working) image.

Tried both on Claude 3.5 & GPT-4o.. not getting LLM errors, but seeing strange outputs
Turns out there some incorrect encoding. image viewers seem to be ignoring the incorrect parts
But LLMs are giving errors
this can be a sophisticated prompt injection attack
I doubt it πŸ˜…
I'm getting the image from the figma image API
seems like some intermittent issue in that API
re-processing the image solves the problem
So now I'm releasing that fix
yep, issue fixed
Attachment
image.png
Add a reply
Sign up and join the conversation on Discord