Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,22 @@ public String getFormat() {
return format;
}

@Override
public String generate(Iterable<Map> optionsList) {
List<String> components = new ArrayList<String>();
for (Map options : optionsList) {
if (options.size() > 0) {
components.add(super.generate(options));
}
}

if (StringUtils.isNotBlank(format)){
components.add(format);
}

return StringUtils.join(components, "/");
}

@Override
public String generate(Map options) {
List<String> eager = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package com.cloudinary.test;

import com.cloudinary.Cloudinary;
import com.cloudinary.ResponsiveBreakpoint;
import com.cloudinary.Transformation;
import com.cloudinary.Url;
import com.cloudinary.*;
import com.cloudinary.transformation.*;
import com.cloudinary.utils.ObjectUtils;
import junitparams.JUnitParamsRunner;
Expand All @@ -16,6 +13,7 @@
import org.junit.rules.TestName;
import org.junit.runner.RunWith;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URLDecoder;
Expand Down Expand Up @@ -678,6 +676,18 @@ public void testShouldSupportAutoWidth(String width, String result) {
assertEquals(result, trans);
}

@Test
public void testEagerWithStreamingProfile() throws IOException {
Transformation transformation = new EagerTransformation().format("m3u8").streamingProfile("full_hd");
assertEquals("sp_full_hd/m3u8", transformation.generate());
}

@Test
public void testEagerWithChaining() throws IOException {
Transformation transformation = new EagerTransformation().angle(13).chain().effect("sepia").chain().format("webp");
assertEquals("a_13/e_sepia/webp", transformation.generate());
}

@Test
public void testShouldSupportIhIw() {
String trans = new Transformation().width("iw").height("ih").crop("crop").generate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,6 @@ public void testUniqueFilename() throws Exception {
assertEquals(result.get("public_id"), "old_logo");
}

@Test
public void testEagerWithStreamingProfile() throws IOException {
Transformation transformation = new EagerTransformation().format("m3u8").streamingProfile("full_hd");
assertEquals("sp_full_hd/m3u8", transformation.generate());
}

@Test
public void testExplicit() throws IOException {
Map result = cloudinary.uploader().explicit("sample", asMap("eager", Collections.singletonList(new Transformation().crop("scale").width(2.0)), "type", "upload", "moderation", "manual"));
Expand Down