本文整理汇总了Java中com.squareup.pollexor.Thumbor类的典型用法代码示例。如果您正苦于以下问题:Java Thumbor类的具体用法?Java Thumbor怎么用?Java Thumbor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Thumbor类属于com.squareup.pollexor包,在下文中一共展示了Thumbor类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: simpleResize
import com.squareup.pollexor.Thumbor; //导入依赖的package包/类
@Test public void simpleResize() {
Request input = new Request.Builder(IMAGE_URI).resize(50, 50).build();
Request output = transformer.transformRequest(input);
assertThat(output).isNotSameAs(input);
assertThat(output.hasSize()).isFalse();
String expected = Thumbor.create(HOST).buildImage(IMAGE).resize(50, 50).toUrl();
assertThat(output.uri.toString()).isEqualTo(expected);
}
示例2: simpleResizeOnJbMr2UsesWebP
import com.squareup.pollexor.Thumbor; //导入依赖的package包/类
@Config(sdk = 18)
@Test public void simpleResizeOnJbMr2UsesWebP() {
Request input = new Request.Builder(IMAGE_URI).resize(50, 50).build();
Request output = transformer.transformRequest(input);
assertThat(output).isNotSameAs(input);
assertThat(output.hasSize()).isFalse();
String expected = Thumbor.create(HOST)
.buildImage(IMAGE)
.resize(50, 50)
.filter(format(ImageFormat.WEBP))
.toUrl();
assertThat(output.uri.toString()).isEqualTo(expected);
}
示例3: simpleResizeWithCenterCrop
import com.squareup.pollexor.Thumbor; //导入依赖的package包/类
@Test public void simpleResizeWithCenterCrop() {
Request input = new Request.Builder(IMAGE_URI).resize(50, 50).centerCrop().build();
Request output = transformer.transformRequest(input);
assertThat(output).isNotSameAs(input);
assertThat(output.hasSize()).isFalse();
assertThat(output.centerCrop).isFalse();
String expected = Thumbor.create(HOST).buildImage(IMAGE).resize(50, 50).toUrl();
assertThat(output.uri.toString()).isEqualTo(expected);
}
示例4: simpleResizeWithCenterInside
import com.squareup.pollexor.Thumbor; //导入依赖的package包/类
@Test public void simpleResizeWithCenterInside() {
Request input = new Request.Builder(IMAGE_URI).resize(50, 50).centerInside().build();
Request output = transformer.transformRequest(input);
assertThat(output).isNotSameAs(input);
assertThat(output.hasSize()).isFalse();
assertThat(output.centerInside).isFalse();
String expected = Thumbor.create(HOST).buildImage(IMAGE).resize(50, 50).fitIn().toUrl();
assertThat(output.uri.toString()).isEqualTo(expected);
}
示例5: simpleResizeWithEncryption
import com.squareup.pollexor.Thumbor; //导入依赖的package包/类
@Test public void simpleResizeWithEncryption() {
Request input = new Request.Builder(IMAGE_URI).resize(50, 50).build();
Request output = secureTransformer.transformRequest(input);
assertThat(output).isNotSameAs(input);
assertThat(output.hasSize()).isFalse();
String expected = Thumbor.create(HOST, KEY).buildImage(IMAGE).resize(50, 50).toUrl();
assertThat(output.uri.toString()).isEqualTo(expected);
}
示例6: simpleResizeWithCenterInsideAndEncryption
import com.squareup.pollexor.Thumbor; //导入依赖的package包/类
@Test public void simpleResizeWithCenterInsideAndEncryption() {
Request input = new Request.Builder(IMAGE_URI).resize(50, 50).centerInside().build();
Request output = secureTransformer.transformRequest(input);
assertThat(output).isNotSameAs(input);
assertThat(output.hasSize()).isFalse();
assertThat(output.centerInside).isFalse();
String expected = Thumbor.create(HOST, KEY).buildImage(IMAGE).resize(50, 50).fitIn().toUrl();
assertThat(output.uri.toString()).isEqualTo(expected);
}
示例7: PollexorRequestTransformer
import com.squareup.pollexor.Thumbor; //导入依赖的package包/类
/** Create a transformer for the specified {@link Thumbor}. */
public PollexorRequestTransformer(Thumbor thumbor) {
this.thumbor = thumbor;
}