Package org.structr.web.common.ImageHelper

Examples of org.structr.web.common.ImageHelper.Thumbnail


    final App app = StructrApp.getInstance(securityContext);

    try {
      originalImage.setProperty(File.checksum, newChecksum);

      Thumbnail thumbnailData = ImageHelper.createThumbnail(originalImage, maxWidth, maxHeight, cropToFit);
      if (thumbnailData != null) {

        Integer tnWidth  = thumbnailData.getWidth();
        Integer tnHeight = thumbnailData.getHeight();
        byte[] data      = null;

        try {

          data = thumbnailData.getBytes();
          final String thumbnailName = originalImage.getName() + "_thumb_" + tnWidth + "x" + tnHeight;

          // create thumbnail node
          thumbnail = ImageHelper.createImage(securityContext, data, "image/" + Thumbnail.FORMAT, Image.class, thumbnailName, true);
View Full Code Here

TOP

Related Classes of org.structr.web.common.ImageHelper.Thumbnail

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.