Package com.itstherules.image

Examples of com.itstherules.image.IImage


    File thumbsDirFile = new File(thumbnailsDirectory);
    for (File file : files) {
    try {
      File thumbnailFile = new File(thumbnailsDirectory + file.getName());
      if(!thumbnailFile.exists()){
        IImage image = new AWTImage(file.getAbsolutePath());
        image.scale(125, 125, true, true);
        image.saveAs(thumbnailFile.getAbsolutePath());
        writer.write("<br>Generated thumbnail: <img src=\"/photos/"+currentDirectory+"/thumbnails/"+file.getName()+"\"/><br/>");
        writer.flush();
      }
    } catch (IOException e) {
      thumbsDirFile.delete();
View Full Code Here


    String baseDirectory = getServletContext().getInitParameter("directory");
    String noImageImage = getServletConfig().getInitParameter("noImageImage");
    int width = getIntParameter(getServletConfig(), "width");
    int height = getIntParameter(getServletConfig(), "height");
    try {
      IImage image = new AWTImage(PathResolver.resolve(baseDirectory+imageName, ImageServlet.class));
          if(width!=0 || height != 0){
              image.scale(width, height, true, true);
          }
          if(image.getWidth() > FLASH_PIXEL_HARD_LIMIT || image.getHeight() > FLASH_PIXEL_HARD_LIMIT){
            image.scale(FLASH_PIXEL_HARD_LIMIT, FLASH_PIXEL_HARD_LIMIT, true, true);
          }
          image.streamTo(resp.getOutputStream());
        } catch(Exception e){
      IImage image = new AWTImage(PathResolver.resolve("com/itstherules/mediacentre"+noImageImage, ImageServlet.class));
           image.streamTo(resp.getOutputStream());
        }
  }
View Full Code Here

 
  @Override
  public void update(Map<String, Object> parameters, HttpServletResponse response) throws IOException {
    String directory = (String) parameters.get("directory");
    String imageName = (String) parameters.get("image");
    IImage image = new AWTImage(PathResolver.resolve("photos/"+directory+"/"+imageName, PhotosController.class));
    image.rotate(getIntParameter(parameters.get("rotation")));
    image.scale(getIntParameter(parameters.get("width")), getIntParameter(parameters.get("height")), true, true);
    image.save();
    try {
      IImage thumbnailImage = new AWTImage(PathResolver.resolve("photos/"+directory+"/thumbnails/"+imageName, PhotosController.class));
        thumbnailImage.rotate(getIntParameter(parameters.get("rotation")));
        thumbnailImage.save();
    } catch(FileNotFoundException e){
    }
    PrintWriter writer = response.getWriter();
    writer.write("saved=true");
    writer.close();
View Full Code Here

TOP

Related Classes of com.itstherules.image.IImage

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.