API error 400 "Unsupported Image" for portrait orientation pictures

Same here, my users are not happy! For now i’ve switched to using Claude it’s a little slower but as good as GPT4o…When did you start noticing these issues? also are you noticing this issue specifically for images uploaded by users?

Does image compression ensure that it alwayas works? I’m considering this but it may add 20s to 1 minute to the api call :sob:

I’ve looked at so many random forum posts about this problem and it’s hard for me to sort out exactly what the facts are. My app is in development so doesn’t have many daily users so it’s difficult to say when this issue started for me, but I saw someone say this problem started on August 5th (the same day this thread was created), which seems about right when I look through server logs. But I’ve seen other people say this started earlier.

The issue seems to be connected to the image files themselves - something to do with vertically oriented images somehow. If I upload a problematic image to my app from my phone, that same image file still causes problems if I send it to my computer or any device and upload it from there.

My leading theory is that there is a bug with the way OpenAI rescales and splits images into 512x512px tiles when processing an image in high-res mode. I’m thinking that vertically oriented, high-resolution photos somehow break some boundaries during this process and throw errors. I could be 100% wrong though, that really is just a guess.

Either way, scaling down the image before sending to the API is the fix I’m going to be trying but I’m still working on testing this out. Has anyone given this a shot?

1 Like

What we need is some of these images as-is to run testing on

1 Like

I’m not sure if it’s exactly the case for GPT4o, but after switching to Claude as the workaround i’m getting similar errors with image upload. However, the error message from Claude API is pretty specific :

“messages.0.content.1.image.source.base64: image exceeds 5 MB maximum: 8680756 bytes > 5242880 bytes”

I’ve noticed this error occurring specifically when users upload images from their mobile device

You absolutely need need NEED to normalize any form of images you receive.

This involves verifying (file size is fair, extension is true) & formatting (strip Exif data, use a common type like webp)

There was a user that had similar issues: seemingly intermittent failures on images. The issue was a result of the device that was taking the photo because it was attaching a whole bunch of weird tags to it, which OpenAI was refusing due to the weird signature.