Package gov.lanl.adore.djatoka

Examples of gov.lanl.adore.djatoka.ICompress


  public File processImage(File img, URI uri) throws DjatokaException {
    String imgPath = img.getAbsolutePath();
    String fmt = formatMap.get(imgPath.substring(imgPath.lastIndexOf('.') + 1).toLowerCase());
    try {
      if (fmt == null || !ImageProcessingUtils.isJp2Type(fmt)) {
        ICompress jp2 = new KduCompressExe();
        File jp2Local = File.createTempFile("cache" + uri.hashCode() + "-", ".jp2");
        jp2Local.delete();
        jp2.compressImage(img.getAbsolutePath(), jp2Local.getAbsolutePath(), new DjatokaEncodeParam());
        img.delete();
        img = jp2Local;
      } else {
        try {
          IExtract ex = new KduExtractExe();
View Full Code Here


    public File processImage(File img, final URI uri) throws DjatokaException {
        final String imgPath = img.getAbsolutePath();
        final String fmt = formatMap.get(imgPath.substring(imgPath.lastIndexOf('.') + 1).toLowerCase());
        try {
            if (fmt == null || !ImageProcessingUtils.isJp2Type(fmt)) {
                final ICompress jp2 = new KduCompressExe();
                final File jp2Local = File.createTempFile("cache" + uri.hashCode() + "-", ".jp2");
                if (!jp2Local.delete() && LOGGER.isWarnEnabled()) {
                    LOGGER.warn("File not deleted: {}", jp2Local);
                }
                jp2.compressImage(img.getAbsolutePath(), jp2Local.getAbsolutePath(), new DjatokaEncodeParam());
                if (!img.delete() && LOGGER.isWarnEnabled()) {
                    LOGGER.warn("File not deleted: {}", img);
                }
                img = jp2Local;
            } else {
View Full Code Here

TOP

Related Classes of gov.lanl.adore.djatoka.ICompress

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.