當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。