Skip to content

Commit 739e386

Browse files
authored
Add variable support to Transformation.opacity() (#209)
1 parent 1c47a33 commit 739e386

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public T delay(Object value) {
202202
return param("delay", value);
203203
}
204204

205-
public T opacity(int value) {
205+
public T opacity(Object value) {
206206
return param("opacity", value);
207207
}
208208

cloudinary-core/src/test/java/com/cloudinary/test/CloudinaryTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,10 @@ public void testOpacity() {
527527
Transformation transformation = new Transformation().opacity(50);
528528
String result = cloudinary.url().transformation(transformation).generate("test");
529529
assertEquals(DEFAULT_UPLOAD_PATH + "o_50/test", result);
530+
531+
transformation = new Transformation().opacity("$var");
532+
result = cloudinary.url().transformation(transformation).generate("test");
533+
assertEquals(DEFAULT_UPLOAD_PATH + "o_$var/test", result);
530534
}
531535

532536
@SuppressWarnings("unchecked")

0 commit comments

Comments
 (0)