Skip to content

Commit

Permalink
vision: Got empty response when requests are gzipped. (#341)
Browse files Browse the repository at this point in the history
  • Loading branch information
tswast authored and dpebot committed Sep 19, 2016
1 parent c817c92 commit 5bb2b92
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public List<EntityAnnotation> labelImage(Path path, int maxResults) throws IOExc
vision.images()
.annotate(new BatchAnnotateImagesRequest().setRequests(ImmutableList.of(request)));
// Due to a bug: requests to Vision API containing large images fail when GZipped.
// annotate.setDisableGZipContent(true);
annotate.setDisableGZipContent(true);
// [END construct_request]

// [START parse_response]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ public List<EntityAnnotation> identifyLandmark(String uri, int maxResults) throw
Vision.Images.Annotate annotate =
vision.images()
.annotate(new BatchAnnotateImagesRequest().setRequests(ImmutableList.of(request)));
// Due to a bug: requests to Vision API containing large images fail when GZipped.
annotate.setDisableGZipContent(true);

BatchAnnotateImagesResponse batchResponse = annotate.execute();
assert batchResponse.getResponses().size() == 1;
Expand Down

0 comments on commit 5bb2b92

Please sign in to comment.