Examples of OutputSettings


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

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

 
  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

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

    @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

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

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

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

    }

    @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

Examples of org.jsoup.nodes.Document.OutputSettings

        String style = e.attr("style");
        String escaped = escapeImgCss(style);
        e.attr("style", escaped);
      }

      clean.outputSettings(new OutputSettings().escapeMode(EscapeMode.base).prettyPrint(false));
      Element body = clean.body();
      if (keepTextOnly) {
        content = body.text();
      } else {
        content = body.html();
View Full Code Here

Examples of org.jsoup.nodes.Document.OutputSettings

import java.nio.charset.Charset;

public class EntitiesTest {
    @Test public void escape() {
        String text = "Hello &<> Å å π 新 there ¾ © »";
        String escapedAscii = Entities.escape(text, new OutputSettings().charset("ascii").escapeMode(base));
        String escapedAsciiFull = Entities.escape(text, new OutputSettings().charset("ascii").escapeMode(extended));
        String escapedAsciiXhtml = Entities.escape(text, new OutputSettings().charset("ascii").escapeMode(xhtml));
        String escapedUtfFull = Entities.escape(text, new OutputSettings().charset("UTF-8").escapeMode(base));
        String escapedUtfMin = Entities.escape(text, new OutputSettings().charset("UTF-8").escapeMode(xhtml));

        assertEquals("Hello &amp;&lt;&gt; &Aring; &aring; &#x3c0; &#x65b0; there &frac34; &copy; &raquo;", escapedAscii);
        assertEquals("Hello &amp;&lt;&gt; &angst; &aring; &pi; &#x65b0; there &frac34; &copy; &raquo;", escapedAsciiFull);
        assertEquals("Hello &amp;&lt;&gt; &#xc5; &#xe5; &#x3c0; &#x65b0; there &#xbe; &#xa9; &#xbb;", escapedAsciiXhtml);
        assertEquals("Hello &amp;&lt;&gt; Å å π 新 there ¾ © »", escapedUtfFull);
View Full Code Here

Examples of org.jsoup.nodes.Document.OutputSettings

        assertEquals(text, Entities.unescape(escapedUtfMin));
    }

    @Test public void escapeSupplementaryCharacter(){
        String text = new String(Character.toChars(135361));
        String escapedAscii = Entities.escape(text, new OutputSettings().charset("ascii").escapeMode(base));
        assertEquals("&#x210c1;", escapedAscii);
        String escapedUtf = Entities.escape(text, new OutputSettings().charset("UTF-8").escapeMode(base));
        assertEquals(text, escapedUtf);
    }
View Full Code Here

Examples of org.jsoup.nodes.Document.OutputSettings

   
    @Test public void caseSensitive() {
        String unescaped = "Ü ü & &";
        assertEquals("&Uuml; &uuml; &amp; &amp;",
                Entities.escape(unescaped, new OutputSettings().charset("ascii").escapeMode(extended)));
       
        String escaped = "&Uuml; &uuml; &amp; &AMP";
        assertEquals("Ü ü & &", Entities.unescape(escaped));
    }
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.