Examples of imageSize()


Examples of com.google.appengine.api.images.ServingUrlOptions.imageSize()

    byte[] imageData = BLOB_STORE.fetchData(blobKey, 0, bytes.length);
    assertArrayEquals(bytes, imageData);

    ServingUrlOptions opts = ServingUrlOptions.Builder.withBlobKey(blobKey);
    opts.imageSize(bytes.length);
    String url = IMAGES_SERVICE.getServingUrl(opts);
    assertTrue(url.length() > 0);
  }
}
View Full Code Here

Examples of com.google.appengine.api.images.ServingUrlOptions.imageSize()

    @Test
    public void servingUrlWithImageSize() throws Exception {
        ServingUrlOptions servingUrlOptions = ServingUrlOptions.Builder.withBlobKey(blobKey);
        String baseUrl = imagesService.getServingUrl(servingUrlOptions);
        String actualUrl = imagesService.getServingUrl(servingUrlOptions.imageSize(32).crop(false));
        String expectedUrl = baseUrl + "=s32";
        assertEquals(expectedUrl, actualUrl);
    }

    @Test
View Full Code Here

Examples of com.google.appengine.api.images.ServingUrlOptions.imageSize()

    @Test
    public void servingUrlWithImageSizeAndCrop() throws Exception {
        ServingUrlOptions servingUrlOptions = ServingUrlOptions.Builder.withBlobKey(blobKey);
        String baseUrl = imagesService.getServingUrl(servingUrlOptions);
        String actualUrl = imagesService.getServingUrl(servingUrlOptions.imageSize(32).crop(true));
        String expectedUrl = baseUrl + "=s32-c";
        assertEquals(expectedUrl, actualUrl);
    }

    @Test
View Full Code Here

Examples of com.google.appengine.api.images.ServingUrlOptions.imageSize()

    public void servingUrlWithSecureFlagFalse() throws Exception {
        ServingUrlOptions servingUrlOptions = ServingUrlOptions.Builder.withBlobKey(blobKey);
        String url = imagesService.getServingUrl(servingUrlOptions.crop(false));
        assertStartsWith("http://", url);

        url = imagesService.getServingUrl(servingUrlOptions.imageSize(32).crop(false).secureUrl(false));
        assertStartsWith("http://", url);
    }

    @Test
    public void servingUrlWithSecureFlagTrue() throws Exception {
View Full Code Here

Examples of com.google.appengine.api.images.ServingUrlOptions.imageSize()

        ServingUrlOptions servingUrlOptions = ServingUrlOptions.Builder.withBlobKey(blobKey);
        String url = imagesService.getServingUrl(servingUrlOptions.secureUrl(true));
        assertStartsWith("https://", url);

        url = imagesService.getServingUrl(servingUrlOptions.imageSize(32).crop(false).secureUrl(true));
        assertStartsWith("https://", url);
    }

    @Test
    public void servingUrlWithOptionsWithImageSize() throws Exception {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.