I am getting an error when using Google Cloud Vertex AI to analyze images. This seems to happen for gif images, specifically. The error is: "the service reports an error with code INVALID_ARGUMENT described as: Request contains an invalid argument."
Is there any special situation related to animated gifs and the fileUri method of specifying a Cloud Storage bucket uri? The same code works well for non-gifs, and the same gifs work well when using Gemini outside of Vertex.
Full context:
I am building a web app which allows users to upload images and have them automatically analyzed via Gemini.
When using the "public" (external facing) Gemini API and an API key, I include the image as part of the request payload use base64-encoding. This has worked flawlessly for many months on several different image types, including gifs.
When running in Google Cloud, I am trying to use Vertex AI to accomplish the same inference using the same prompt, but instead of inlining the image data I am passing a fileURI to my storage bucket. This works most to the time, but fails cryptically for some gifs.
The same images which work for via the inlineData method (against the public API) do not work when using fileUri against the vertex AI.
Model (same for both endpoints):
gemini-3-flash-preview
An example gif that is failing for me is this one from the movie Point Break: https://giphy.com/gifs/break-point-ulvR63po0dMJ2
My gut is that because these gifs are "animated", there is some special scenario related to fileUri that I am missing. Perhaps they should be passed as video references somehow? Is there anything special with gifs and fileUri?
I can't find any reference to gif specifically in these Gemini docs. I can try to work on a repro, but it's a little tricky given that it references internal GCloud endpoints, buckets, etc.