Skip to content

Add support for cinemagraph_analysis param. #182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cloudinary-core/src/main/java/com/cloudinary/Api.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public ApiResponse resource(String public_id, Map options) throws Exception {

ApiResponse response = callApi(HttpMethod.GET, Arrays.asList("resources", resourceType, type, public_id),
ObjectUtils.only(options, "exif", "colors", "faces", "coordinates",
"image_metadata", "pages", "phash", "max_results", "quality_analysis"), options);
"image_metadata", "pages", "phash", "max_results", "quality_analysis", "cinemagraph_analysis"), options);

return response;
}
Expand Down
2 changes: 1 addition & 1 deletion cloudinary-core/src/main/java/com/cloudinary/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

public class Util {
static final String[] BOOLEAN_UPLOAD_OPTIONS = new String[]{"backup", "exif", "faces", "colors", "image_metadata", "use_filename", "unique_filename",
"eager_async", "invalidate", "discard_original_filename", "overwrite", "phash", "return_delete_token", "async", "quality_analysis"};
"eager_async", "invalidate", "discard_original_filename", "overwrite", "phash", "return_delete_token", "async", "quality_analysis", "cinemagraph_analysis"};

@SuppressWarnings({"rawtypes", "unchecked"})
public static final Map<String, Object> buildUploadParams(Map options) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -951,4 +951,11 @@ public void testDeleteFolder() throws Exception {
// should throw exception (folder not found):
api.deleteFolder(cloudinary.randomPublicId(), emptyMap());
}


@Test
public void testCinemagraphAnalysisResource() throws Exception {
ApiResponse res = api.resource(API_TEST, Collections.singletonMap("cinemagraph_analysis", true));
assertNotNull(res.get("cinemagraph_analysis"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,15 @@ public void testQualityAnalysis() throws IOException {

}

@Test
public void testCinemagraphAnalysisUpload() throws IOException {
Map result = cloudinary.uploader().upload(SRC_TEST_IMAGE, asMap("cinemagraph_analysis", true, "tags", Arrays.asList(SDK_TEST_TAG, UPLOADER_TAG)));
assertNotNull(result.get("cinemagraph_analysis"));
result = cloudinary.uploader().explicit(result.get("public_id").toString(), ObjectUtils.asMap("type", "upload", "resource_type", "image", "cinemagraph_analysis", true));
assertNotNull(result.get("cinemagraph_analysis"));

}

private void addToDeleteList(String type, String id) {
Set<String> ids = toDelete.get(type);
if (ids == null) {
Expand Down