Package org.apache.sanselan

Examples of org.apache.sanselan.ImageFormat


{

  private static boolean isPng(File file) throws IOException,
      ImageReadException
  {
    ImageFormat format = Sanselan.guessFormat(file);
    return format == ImageFormat.IMAGE_FORMAT_PNG;
  }
View Full Code Here



  protected static boolean isJpeg(File file) throws IOException,
      ImageReadException
  {
    ImageFormat format = Sanselan.guessFormat(file);
    return format == ImageFormat.IMAGE_FORMAT_JPEG;
  }
View Full Code Here

  //  }

  private static boolean isTiff(File file) throws IOException,
      ImageReadException
  {
    ImageFormat format = Sanselan.guessFormat(file);
    return format == ImageFormat.IMAGE_FORMAT_TIFF;
  }
View Full Code Here

      TiffField field = (TiffField) entries.get(i);
      String comment = field.toString();
      comments.add(comment);
    }

    ImageFormat format = ImageFormat.IMAGE_FORMAT_TIFF;
    String formatName = "TIFF Tag-based Image File Format";
    String mimeType = "image/tiff";
    int numberOfImages = contents.directories.size();
    // not accurate ... only reflects first
    boolean isProgressive = false;
View Full Code Here

    ArrayList Comments = new ArrayList();
    // TODO: comments...

    int bitsPerPixel = bhi.bitsPerPixel;
    ImageFormat format = ImageFormat.IMAGE_FORMAT_BMP;
    String fName = "BMP Windows Bitmap";
    String mimeType = "image/x-ms-bmp";
    // we ought to count images, but don't yet.
    int numberOfImages = -1;
    // not accurate ... only reflects first
View Full Code Here

          "@broken"))
        checkGetImageInfo(imageFile, imageFileBytes);

      checkGetImageSize(imageFile, imageFileBytes);

      ImageFormat imageFormat = Sanselan.guessFormat(imageFile);
      if (ImageFormat.IMAGE_FORMAT_JPEG == imageFormat
          || ImageFormat.IMAGE_FORMAT_UNKNOWN == imageFormat)
        ;
      else
        checkGetBufferedImage(imageFile, imageFileBytes);
View Full Code Here

  }

  public void checkGuessFormat(File imageFile, byte[] imageFileBytes)
      throws IOException, ImageReadException {
    // check guessFormat()
    ImageFormat imageFormatFile = Sanselan.guessFormat(imageFile);
    assertTrue(imageFormatFile != null);
    assertTrue(imageFormatFile != ImageFormat.IMAGE_FORMAT_UNKNOWN);
    // Debug.debug("imageFormatFile", imageFormatFile);

    ImageFormat imageFormatBytes = Sanselan.guessFormat(imageFileBytes);
    assertTrue(imageFormatBytes != null);
    assertTrue(imageFormatBytes != ImageFormat.IMAGE_FORMAT_UNKNOWN);
    // Debug.debug("imageFormatBytes", imageFormatBytes);

    assertTrue(imageFormatBytes == imageFormatFile);
View Full Code Here

    ArrayList Comments;

    Comments = getComments(blocks.blocks);

    int BitsPerPixel = (bhi.colorResolution + 1) * 3;
    ImageFormat Format = ImageFormat.IMAGE_FORMAT_GIF;
    String FormatName = "GIF Graphics Interchange Format";
    String MimeType = "image/gif";
    // we ought to count images, but don't yet.
    int NumberOfImages = -1;

View Full Code Here

        Comments.add(pngChunkzTXt.Keyword + ": " + pngChunkzTXt.Text);
      }

      int BitsPerPixel = pngChunkIHDR.bitDepth
          * samplesPerPixel(pngChunkIHDR.colorType);
      ImageFormat Format = ImageFormat.IMAGE_FORMAT_PNG;
      String FormatName = "PNG Portable Network Graphics";
      int Height = pngChunkIHDR.height;
      String MimeType = "image/png";
      int NumberOfImages = 1;
      int Width = pngChunkIHDR.width;
View Full Code Here

    ArrayList Comments;

    Comments = getComments(blocks.blocks);

    int BitsPerPixel = (bhi.colorResolution + 1) * 3;
    ImageFormat Format = ImageFormat.IMAGE_FORMAT_GIF;
    String FormatName = "GIF Graphics Interchange Format";
    String MimeType = "image/gif";
    // we ought to count images, but don't yet.
    int NumberOfImages = -1;

View Full Code Here

TOP

Related Classes of org.apache.sanselan.ImageFormat

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.