Examples of KduExtractExe


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

      IExtract ex = null;
      if (alt != null) {
                System.out.println("alt: " + alt);
        ex = (IExtract) Class.forName(alt).newInstance();
            } else {
                 ex = new KduExtractExe();
            }
      DjatokaExtractProcessor e = new DjatokaExtractProcessor(ex);
      e.extractImage(input, output, p, format);
      logger.info("Extraction Time: " + ((double) (System.currentTimeMillis() - x) / 1000) + " seconds");
       
View Full Code Here

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

        } catch (InstantiationException ex) {
            logger.log(Priority.FATAL, null, ex);
        } catch (IllegalAccessException ex) {
            logger.log(Priority.FATAL, null, ex);
        }
        extractors.put(DEFAULT_EXTRACTOR, (IExtract) new KduExtractExe());
        return extractors.get(DEFAULT_EXTRACTOR);
    }
View Full Code Here

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

    String responseFormat = "application/xml";;
    int status = HttpServletResponse.SC_OK;
    ByteArrayOutputStream baos =  new ByteArrayOutputStream();
      try {
      baos = new ByteArrayOutputStream();
      IExtract jp2 = new KduExtractExe();
      ImageRecord r = ReferentManager.getImageRecord(contextObject.getReferent());
      String[] xml = jp2.getXMLBox(r);
      StringBuffer sb = new StringBuffer("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
            sb.append("<jp2:JP2XML xmlns:jp2=\"http://library.lanl.gov/2008-11/aDORe/JP2XML/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"  xsi:schemaLocation=\"http://library.lanl.gov/2008-11/aDORe/JP2XML/ http://purl.lanl.gov/aDORe/schemas/2008-11/JP2XML.xsd\"");           
            sb.append(" boxCount=\"" + ((xml != null) ? xml.length : 0) + "\">");
      if (xml != null) {
        for (String x : xml) {
View Full Code Here

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

        jp2.compressImage(img.getAbsolutePath(), jp2Local.getAbsolutePath(), new DjatokaEncodeParam());
        img.delete();
        img = jp2Local;
      } else {
        try {
          IExtract ex = new KduExtractExe();
          ex.getMetadata(new ImageRecord(uri.toString(), img.getAbsolutePath()));
        } catch (DjatokaException e) {
          throw new DjatokaException("Unknown JP2/JPX file format");
        }
      }
    } catch (Exception e) {
View Full Code Here

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

            if (output == null) {
                output = input + ".jpg";
            }

            long x = System.currentTimeMillis();
            IExtract ex = new KduExtractExe();
            if (alt != null) {
                ex = (IExtract) Class.forName(alt).newInstance();
            }
            DjatokaExtractProcessor e = new DjatokaExtractProcessor(ex);
            e.extractImage(input, output, p, format);
View Full Code Here

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

                    LOGGER.warn("File not deleted: {}", img);
                }
                img = jp2Local;
            } else {
                try {
                    final IExtract ex = new KduExtractExe();
                    ex.getMetadata(new ImageRecord(uri.toString(), img.getAbsolutePath()));
                } catch (final DjatokaException e) {
                    throw new DjatokaException("Unknown JP2/JPX file format");
                }
            }
        } catch (final Exception e) {
View Full Code Here

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

                        }
                    }
                } else {
                    scaleCacheExceptions = new HashSet<Double>();
                }
                extractor = new DjatokaExtractProcessor(new KduExtractExe());
                init = true;
            }
        } catch (final IOException e) {
            LOGGER.error(e.getMessage(), e);
            throw new ResolverException("Error attempting to open props file from classpath, disabling " + SVC_ID +
View Full Code Here

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

        ByteArrayOutputStream baos = new ByteArrayOutputStream();

        try {
            final ObjectMapper mapper = new ObjectMapper();
            final ObjectNode rootNode = mapper.createObjectNode();
            final IExtract jp2 = new KduExtractExe();

            ImageRecord r = ReferentManager.getImageRecord(contextObject.getReferent());
            r = jp2.getMetadata(r);

            rootNode.put("identifier", r.getIdentifier());
            rootNode.put("imagefile", r.getImageFile());
            rootNode.put("width", r.getWidth());
            rootNode.put("height", r.getHeight());
View Full Code Here

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

        String responseFormat = "application/xml";;
        int status = HttpServletResponse.SC_OK;
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        try {
            baos = new ByteArrayOutputStream();
            IExtract jp2 = new KduExtractExe();
            ImageRecord r = ReferentManager.getImageRecord(contextObject.getReferent());
            String[] xml = jp2.getXMLBox(r);
            StringBuffer sb = new StringBuffer("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
            sb.append("<jp2:JP2XML ");
            sb.append("xmlns:jp2=\"http://library.lanl.gov/2008-11/aDORe/JP2XML/\" ");
            sb.append("xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"  ");
            sb.append("xsi:schemaLocation=\"http://library.lanl.gov/2008-11/aDORe/JP2XML/ ");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.