Package com.google.appengine.api.images

Examples of com.google.appengine.api.images.OutputSettings


        if (p.x2() - p.x1() > 10 && p.y2() - p.y1() > 10) {
          double xs = image.getWidth();
          double ys = image.getHeight();
          Transform crop = ImagesServiceFactory.makeCrop(p.x1() / xs, p.y1() / ys, p.x2() / xs, p.y2() / ys);
         
          OutputSettings jpeg = new OutputSettings(OutputEncoding.JPEG);
          image = ImagesServiceFactory.getImagesService().applyTransform(crop, image, jpeg);
        }
      }
     
      final ProfilePictureData profilePicture = ProfilePictureData.getProfilePicture(image.getImageData());
View Full Code Here


 
  private static Image normalizeProfilePicture(Image uploadedImage) {
    ImagesService imagesService = ImagesServiceFactory.getImagesService();
    Transform resize = ImagesServiceFactory.makeResize(250, 500);
   
    OutputSettings jpeg = new OutputSettings(OutputEncoding.JPEG);
   
    Image profileImage = imagesService.applyTransform(resize, uploadedImage, jpeg);
    if (profileImage.getFormat() != Format.JPEG)
      throw new AssertionError("Wrong format: " + profileImage.getFormat());
   
View Full Code Here

    @Test
    public void testSettings() throws IOException {
        Image originalImage = readImage(CAPEDWARF_PNG);
        Composite c1 = ImagesServiceFactory.makeComposite(originalImage, 0, 0, 1, Composite.Anchor.BOTTOM_LEFT);
        Image ci = imagesService.composite(newArrayList(c1), 200, 143, 0, new OutputSettings(OutputEncoding.JPEG));
        assertImages(null, originalImage, ci);
    }
View Full Code Here

public class TransformationsTest extends ImagesServiceTestBase {

    @Test
    public void testResize() throws IOException {
        InputSettings inputSettings = new InputSettings();
        OutputSettings outputSettings = new OutputSettings(OutputEncoding.PNG);

        Image originalImage = readImage(CAPEDWARF_PNG);
        assertEquals(200, originalImage.getWidth());
        assertEquals(143, originalImage.getHeight());
View Full Code Here

    }

    @Test
    public void testResizeAsync() throws IOException {
        InputSettings inputSettings = new InputSettings();
        OutputSettings outputSettings = new OutputSettings(OutputEncoding.PNG);

        Image originalImage = readImage(CAPEDWARF_PNG);
        Image resizedImage = waitOnFuture(imagesService.applyTransformAsync(ImagesServiceFactory.makeResize(400, 286), originalImage));
        assertEquals(400, resizedImage.getWidth());
        assertEquals(286, resizedImage.getHeight());
View Full Code Here

TOP

Related Classes of com.google.appengine.api.images.OutputSettings

Copyright © 2018 www.massapicom. 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.