Skip to content

Commit 9d9d266

Browse files
authored
Add support for cinemagraph_analysis param. (#182)
1 parent e4e3ec2 commit 9d9d266

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

cloudinary-core/src/main/java/com/cloudinary/Api.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public ApiResponse resource(String public_id, Map options) throws Exception {
125125

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

130130
return response;
131131
}

cloudinary-core/src/main/java/com/cloudinary/Util.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

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

1313
@SuppressWarnings({"rawtypes", "unchecked"})
1414
public static final Map<String, Object> buildUploadParams(Map options) {

cloudinary-test-common/src/main/java/com/cloudinary/test/AbstractApiTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -951,4 +951,11 @@ public void testDeleteFolder() throws Exception {
951951
// should throw exception (folder not found):
952952
api.deleteFolder(cloudinary.randomPublicId(), emptyMap());
953953
}
954+
955+
956+
@Test
957+
public void testCinemagraphAnalysisResource() throws Exception {
958+
ApiResponse res = api.resource(API_TEST, Collections.singletonMap("cinemagraph_analysis", true));
959+
assertNotNull(res.get("cinemagraph_analysis"));
960+
}
954961
}

cloudinary-test-common/src/main/java/com/cloudinary/test/AbstractUploaderTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,15 @@ public void testQualityAnalysis() throws IOException {
680680

681681
}
682682

683+
@Test
684+
public void testCinemagraphAnalysisUpload() throws IOException {
685+
Map result = cloudinary.uploader().upload(SRC_TEST_IMAGE, asMap("cinemagraph_analysis", true, "tags", Arrays.asList(SDK_TEST_TAG, UPLOADER_TAG)));
686+
assertNotNull(result.get("cinemagraph_analysis"));
687+
result = cloudinary.uploader().explicit(result.get("public_id").toString(), ObjectUtils.asMap("type", "upload", "resource_type", "image", "cinemagraph_analysis", true));
688+
assertNotNull(result.get("cinemagraph_analysis"));
689+
690+
}
691+
683692
private void addToDeleteList(String type, String id) {
684693
Set<String> ids = toDelete.get(type);
685694
if (ids == null) {

0 commit comments

Comments
 (0)