Skip to content

Commit de6deda

Browse files
committed
Merge pull request cloudinary#9 from AssuredLabor/transformationAttr
add transformation attribute to cloudinary upload tag
2 parents 80562d9 + 4ec90da commit de6deda

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

cloudinary-taglib/src/main/java/com/cloudinary/taglib/CloudinaryUploadTag.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public class CloudinaryUploadTag extends SimpleTagSupport {
2020
private String tags = null;
2121
private String fieldName;
2222
private String resourceType = "auto";
23+
private String transformation;
2324

2425
public void doTag() throws JspException, IOException {
2526
Cloudinary cloudinary = Singleton.getCloudinary();
@@ -37,6 +38,7 @@ public void doTag() throws JspException, IOException {
3738

3839
Map<String, String> options = new HashMap<String, String>();
3940
options.put("resource_type", resourceType);
41+
options.put("transformation", transformation);
4042
if (tags != null) {
4143
options.put("tags", tags);
4244
}
@@ -85,6 +87,14 @@ public void setFieldName(String fieldName) {
8587
public String getFieldName() {
8688
return fieldName;
8789
}
90+
91+
public void setTransformation(String transformation) {
92+
this.transformation = transformation;
93+
}
94+
95+
public String getTransformation() {
96+
return transformation;
97+
}
8898

8999
public void setResourceType(String resourceType) {
90100
this.resourceType = resourceType;

cloudinary-taglib/src/main/resources/META-INF/cloudinary.tld

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@
4040
<required>false</required>
4141
<rtexprvalue>true</rtexprvalue>
4242
</attribute>
43+
<attribute>
44+
<name>transformation</name>
45+
<required>false</required>
46+
<rtexprvalue>true</rtexprvalue>
47+
</attribute>
4348
</tag>
4449
<tag>
4550
<name>image</name>

0 commit comments

Comments
 (0)