Package org.apache.sanselan

Examples of org.apache.sanselan.ImageInfo


      // <b>get the image's width and height. </b>
      Dimension d = Sanselan.getImageSize(imageBytes);

      // <b>get all of the image's info (ie. bits per pixel, size, transparency, etc.) </b>
      ImageInfo imageInfo = Sanselan.getImageInfo(imageBytes);

      if (imageInfo.getColorType() == ImageInfo.COLOR_TYPE_GRAYSCALE)
        System.out.println("Grayscale image.");
      if (imageInfo.getHeight() > 1000)
        System.out.println("Large image.");

      // <b>try to guess the image's format. </b>
      ImageFormat image_format = Sanselan.guessFormat(imageBytes);
      image_format.equals(ImageFormat.IMAGE_FORMAT_PNG);
View Full Code Here


    boolean usesPalette = false;

    int ColorType = info.getColorType();
    String compressionAlgorithm = ImageInfo.COMPRESSION_ALGORITHM_NONE;

    ImageInfo result = new ImageInfo(FormatDetails, BitsPerPixel, Comments,
        Format, FormatName, info.height, MimeType, NumberOfImages,
        PhysicalHeightDpi, PhysicalHeightInch, PhysicalWidthDpi,
        PhysicalWidthInch, info.width, isProgressive, isTransparent,
        usesPalette, ColorType, compressionAlgorithm);
View Full Code Here

  public boolean dumpImageFile(PrintWriter pw, ByteSource byteSource)
      throws ImageReadException, IOException {
    pw.println("pnm.dumpImageFile");

    {
      ImageInfo fImageData = getImageInfo(byteSource);
      if (fImageData == null)
        return false;

      fImageData.toString(pw, "");
    }

    pw.println("");

    return true;
View Full Code Here

              !ignoreImageData));

      IImageMetadata metadata = Sanselan.getMetadata(imageFile, params);
      //      assertNotNull(metadata);

      ImageInfo imageInfo = Sanselan.getImageInfo(imageFile, params);
      assertNotNull(imageInfo);
    }
  }
View Full Code Here

      Debug.debug("imageFile", imageFile);

      IImageMetadata metadata = Sanselan.getMetadata(imageFile);
      assertNotNull(metadata);

      ImageInfo imageInfo = Sanselan.getImageInfo(imageFile);
      assertNotNull(imageInfo);

      BufferedImage image = Sanselan.getBufferedImage(imageFile);
      assertNotNull(image);
    }
View Full Code Here

      default :
        compressionAlgorithm = ImageInfo.COMPRESSION_ALGORITHM_UNKNOWN;
        break;
    }

    ImageInfo result = new ImageInfo(formatDetails, bitsPerPixel, comments,
        format, formatName, height, mimeType, numberOfImages,
        physicalHeightDpi, physicalHeightInch, physicalWidthDpi,
        physicalWidthInch, width, isProgressive, isTransparent,
        usesPalette, colorType, compressionAlgorithm);
View Full Code Here

    try
    {
      pw.println("tiff.dumpImageFile");

      {
        ImageInfo imageData = getImageInfo(byteSource);
        if (imageData == null)
          return false;

        imageData.toString(pw, "");
      }

      pw.println("");

      //    try
View Full Code Here

    boolean usesPalette = colorTable != null;
    int ColorType = ImageInfo.COLOR_TYPE_RGB;
    String compressionAlgorithm = ImageInfo.COMPRESSION_ALGORITHM_RLE;

    ImageInfo result = new ImageInfo(formatDetails, bitsPerPixel, Comments,
        format, fName, Height, mimeType, numberOfImages,
        physicalHeightDpi, physicalHeightInch, physicalWidthDpi,
        physicalWidthInch, Width, isProgressive, isTransparent,
        usesPalette, ColorType, compressionAlgorithm);
View Full Code Here

  public boolean dumpImageFile(PrintWriter pw, ByteSource byteSource)
      throws ImageReadException, IOException
  {
    pw.println("bmp.dumpImageFile");

    ImageInfo imageData = getImageInfo(byteSource, null);
    if (imageData == null)
      return false;

    imageData.toString(pw, "");

    pw.println("");

    return true;
  }
View Full Code Here

        {
        }

        try
        {
          ImageInfo imageInfo = Sanselan.getImageInfo(imageFile);
          // assertNotNull(imageInfo);
          fail("Image read should have failed.");
        } catch (Exception e)
        {
        }

        try
        {
          BufferedImage image = Sanselan.getBufferedImage(imageFile);
          // assertNotNull(image);
          fail("Image read should have failed.");
        } catch (Exception e)
        {
        }
      } else
      {
        IImageMetadata metadata = Sanselan.getMetadata(imageFile);
        // assertNotNull(metadata);

        ImageInfo imageInfo = Sanselan.getImageInfo(imageFile);
        assertNotNull(imageInfo);

        BufferedImage image = Sanselan.getBufferedImage(imageFile);
        assertNotNull(image);
      }
View Full Code Here

TOP

Related Classes of org.apache.sanselan.ImageInfo

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.