diff --git a/vision/label/src/main/java/com/google/cloud/vision/samples/label/LabelApp.java b/vision/label/src/main/java/com/google/cloud/vision/samples/label/LabelApp.java index cf5e0bf90c4..74d8dfd49a9 100644 --- a/vision/label/src/main/java/com/google/cloud/vision/samples/label/LabelApp.java +++ b/vision/label/src/main/java/com/google/cloud/vision/samples/label/LabelApp.java @@ -129,7 +129,7 @@ public List 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] diff --git a/vision/landmark-detection/src/main/java/com/google/cloud/vision/samples/landmarkdetection/DetectLandmark.java b/vision/landmark-detection/src/main/java/com/google/cloud/vision/samples/landmarkdetection/DetectLandmark.java index 289e38c7380..e1df29092d6 100644 --- a/vision/landmark-detection/src/main/java/com/google/cloud/vision/samples/landmarkdetection/DetectLandmark.java +++ b/vision/landmark-detection/src/main/java/com/google/cloud/vision/samples/landmarkdetection/DetectLandmark.java @@ -115,6 +115,8 @@ public List 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;