Google Cloud Vision .NET API fails for content around 1MB in size

56 views
Skip to first unread message

Mike Grommet

unread,
Apr 18, 2016, 8:52:51 AM4/18/16
to google-api-dotnet-client
Here are all of the specifics I believe are relevant:

- Using VB.NET 2010
- Using service account authentication
- Limited to .NET 4.0
- Using these Google libs: Google.Api v1.10.0, Google.Apis.Auth v1.10.0, Google.Apis.Vision.v1 v1.12.0.45
- Performing Text and Safe Search Analysis
- Passing image content in request (not using Google Drive)

When building my requests to send for annotation, if my total encoded file content is less than 1MB, my requests process as expected: I get annotations, and successful results back in the response. Multiple simultaneous annotation requests, as long as the total length is less than 1MB seem to work fine as well.

However, if I use a larger image, or a combination of images exceeding 1MB (encoded), I get an unexpected result. My received response contains no results, or errors. No exceptions are thrown.

While trying to narrow down the root cause, I was able to take the python example on the Google Cloud Vision API website and successfully process large images using the same service account authentication.


I see where the Google Cloud Vision .NET API was just updated a few weeks ago, so I'm wondering if there's a regression, or maybe I'm just missing something.

Matthew Riley

unread,
Apr 18, 2016, 5:33:17 PM4/18/16
to google-api-d...@googlegroups.com
This appears to be a bug with the API serving infrastructure that the Vision API uses. The team is working on it, but in the interim you can get this working by disabling gzip compression for requests:

var visionService = new Google.Apis.Vision.v1.VisionService(new Google.Apis.Services.BaseClientService.Initializer
{
  HTTPClientInitializer = credentialObject,
  GZipEnabled = false
});

Sincere apologies for the inconvenience, and thank you for the report.


--
You received this message because you are subscribed to the Google Groups "google-api-dotnet-client" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-api-dotnet-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages