Package gov.lanl.adore.djatoka.kdu

Examples of gov.lanl.adore.djatoka.kdu.KduCompressExe


        String Cblk = line.getOptionValue("b");
        if (Cblk != null)
          p.setCodeBlockSize(Cblk);
        String alt = line.getOptionValue("a");
       
      ICompress jp2 = new KduCompressExe();
      if (alt != null)
        jp2 = (ICompress) Class.forName(alt).newInstance();
      if (new File(input).isDirectory() && new File(output).isDirectory()) {
        ArrayList<File> files = IOUtils.getFileList(input, new SourceImageFileFilter(), false);
        for (File f : files) {
View Full Code Here


  public void write(BufferedImage bi, OutputStream os) throws FormatIOException {
    if (bi != null) {
      BufferedOutputStream bos = null;
      try {
        params.setLevels(ImageProcessingUtils.getLevelCount(bi.getWidth(), bi.getHeight()));
        KduCompressExe encoder = new KduCompressExe();
        bos = new BufferedOutputStream(os);
        encoder.compressImage(bi, bos, params);
        bos.close();
      } catch (IOException e) {
        logger.error(e,e);
        throw new FormatIOException(e);
      } catch (DjatokaException e) {
View Full Code Here

  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

        myDest = aDest;
        myExts = aExts;
        myThreadRunsUnattended = aUnattendedRun;

        myParams = new DjatokaEncodeParam(aCfg);
        myCompression = new KduCompressExe();

        // Convert maximum file size to bytes
        myMaxSize = Long.parseLong(aCfg.getProperty(MAX_SIZE, "200")) * 1048576;
    }
View Full Code Here

            String jp2ColorSpace = line.getOptionValue("j");
            if (jp2ColorSpace != null) {
                p.setJP2ColorSpace(jp2ColorSpace);
            }

            ICompress jp2 = new KduCompressExe();
            if (alt != null) {
                jp2 = (ICompress) Class.forName(alt).newInstance();
            }
            if (new File(input).isDirectory() && new File(output).isDirectory()) {
                ArrayList<File> files = IOUtils.getFileList(input, new SourceImageFileFilter(), false);
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

    public void write(BufferedImage bi, OutputStream os) throws FormatIOException {
        if (bi != null) {
            BufferedOutputStream bos = null;
            try {
                params.setLevels(ImageProcessingUtils.getLevelCount(bi.getWidth(), bi.getHeight()));
                KduCompressExe encoder = new KduCompressExe();
                bos = new BufferedOutputStream(os);
                encoder.compressImage(bi, bos, params);
                bos.close();
            } catch (IOException details) {
                LOGGER.error(details.getMessage(), details);
                throw new FormatIOException(details.getMessage(), details);
            } catch (DjatokaException details) {
View Full Code Here

TOP

Related Classes of gov.lanl.adore.djatoka.kdu.KduCompressExe

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.