Package org.im4java.core

Examples of org.im4java.core.Info


    FileOutputStream jp2Out = new FileOutputStream(jp2);

    IOUtils.copy(jp2In, jp2Out);

    Info info = new Info(jp2.getAbsolutePath(), true);
    Assert.assertEquals("JP2", info.getImageFormat());

    jp2.delete();
  }
View Full Code Here


  public static int[] tiffToJp2Size(String path) {
    int height = 0;
    int width = 0;
    try {
      Info info = new Info(path, true);

      int tiffHeight = info.getImageHeight();
      height = tiffHeight;
      int tiffWidth = info.getImageWidth();
      width = tiffWidth;
      if (tiffHeight > DEFAULT_MAX_HEIGHT
          || tiffWidth > DEFAULT_MAX_WIDTH) {
        if (tiffHeight > tiffWidth) {
          double ratio = tiffHeight / DEFAULT_MAX_HEIGHT;
View Full Code Here

    } catch (IOException e) {
      e.printStackTrace();
    }

    try {
      Info info = new Info(jp2.getAbsolutePath(), true);
      Assert.assertEquals("JP2", info.getImageFormat());
    } catch (InfoException e) {
      e.printStackTrace();
    }
  }
View Full Code Here

        return true;
    }

    public int getHeight(Image i) throws IOException {
        try {
            Info imageInfo = new Info(getFile(i).getPath());
            return Integer.parseInt(imageInfo.getProperty("Geometry").split("[x+]")[1]);
        } catch (InfoException e) {
            throw new IOException(e.getMessage());
        }
    }
View Full Code Here

        }
    }

    public int getWidth(Image i) throws IOException {
        try {
            Info imageInfo = new Info(getFile(i).getPath());
            return Integer.parseInt(imageInfo.getProperty("Geometry").split("[x+]")[0]);
        } catch (InfoException e) {
            throw new IOException(e.getMessage());
        }
    }
View Full Code Here

      IOUtils.copy(is, fos);
      IOUtils.closeQuietly(fos);
      IOUtils.closeQuietly(is);

      // Load the image from the temporary file
      Info imageInfo = new Info(originalFile.getAbsolutePath(), true);

      // Get the original image size
      int imageWidth = imageInfo.getImageWidth();
      int imageHeight = imageInfo.getImageHeight();

      // Prepare for processing
      ConvertCmd imageMagick = new ConvertCmd();

      // Resizing
View Full Code Here

TOP

Related Classes of org.im4java.core.Info

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.