当前位置: 首页>>代码示例>>Java>>正文


Java Thumbor类代码示例

本文整理汇总了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);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:PollexorRequestTransformerTest.java

示例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);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:15,代码来源:PollexorRequestTransformerTest.java

示例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);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:11,代码来源:PollexorRequestTransformerTest.java

示例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);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:11,代码来源:PollexorRequestTransformerTest.java

示例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);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:PollexorRequestTransformerTest.java

示例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);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:11,代码来源:PollexorRequestTransformerTest.java

示例7: PollexorRequestTransformer

import com.squareup.pollexor.Thumbor; //导入依赖的package包/类
/** Create a transformer for the specified {@link Thumbor}. */
public PollexorRequestTransformer(Thumbor thumbor) {
  this.thumbor = thumbor;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:PollexorRequestTransformer.java


注:本文中的com.squareup.pollexor.Thumbor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。