本文整理匯總了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;
}