Package org.jwildfire.io

Examples of org.jwildfire.io.ImageReader


      File f = File.createTempFile("tmp", "." + fileExt);
      f.deleteOnExit();
      Tools.writeFile(f.getAbsolutePath(), pImageData);

      if ("hdr".equalsIgnoreCase(fileExt)) {
        res = new ImageReader(new JLabel()).loadHDRImage(f.getAbsolutePath());
      }
      else {
        res = new ImageReader(new JLabel()).loadImage(f.getAbsolutePath());
      }
      imageMapByHash.put(key, res);
    }
    return res;
  }
View Full Code Here


        byte[] imgData = downloadRessource(imgUrl);
        String fileExt = RessourceManager.guessImageExtension(imgData);
        File f = File.createTempFile("tmp", "." + fileExt);
        f.deleteOnExit();
        Tools.writeFile(f.getAbsolutePath(), imgData);
        WFImage img = new ImageReader(new JLabel()).loadImage(f.getAbsolutePath());
        if (img.getImageWidth() >= minSize && img.getImageWidth() <= maxSize && img.getImageHeight() >= minSize && img.getImageHeight() <= maxSize) {
          int hashcode = RessourceManager.calcHashCode(imgData);
          SimpleImage wfImg = (SimpleImage) RessourceManager.getImage(hashcode, imgData);
          RGBPalette gradient = new MedianCutQuantizer().createPalette(wfImg);
          return new ImageData(pageUrl, imgUrl, imgData, gradient);
View Full Code Here

TOP

Related Classes of org.jwildfire.io.ImageReader

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.