Package org.apache.sanselan

Examples of org.apache.sanselan.ImageFormat


{

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


public abstract class IcnsBaseTest extends SanselanTest
{

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

                continue;

            Debug.debug("imageFile", imageFile);
            Debug.debug();

            ImageFormat imageFormat = Sanselan.guessFormat(imageFile);

            String xmpXml = Sanselan.getXmpXml(imageFile);
            if (null == xmpXml
                    && imageFormat.equals(ImageFormat.IMAGE_FORMAT_GIF))
                xmpXml = "temporary test until I can locate a GIF with XMP in the wild.";
            if (null == xmpXml)
                continue;

            assertNotNull(xmpXml);

            if (imageFormat.equals(ImageFormat.IMAGE_FORMAT_PNG))
                ;
            else if (imageFormat.equals(ImageFormat.IMAGE_FORMAT_TIFF))
                ;
            else if (imageFormat.equals(ImageFormat.IMAGE_FORMAT_GIF))
                ;
            else
                continue;

            File tempFile = this.createTempFile(imageFile.getName() + ".", "."
View Full Code Here

public abstract class DcxBaseTest extends SanselanTest
{

    private static boolean isDcx(File file) throws IOException, ImageReadException
    {
        ImageFormat format = Sanselan.guessFormat(file);
        return format == ImageFormat.IMAGE_FORMAT_DCX;
    }
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

        int Number_of_components = fSOFNSegment.numberOfComponents;
        int Precision = fSOFNSegment.precision;

        int BitsPerPixel = Number_of_components * Precision;
        ImageFormat Format = ImageFormat.IMAGE_FORMAT_JPEG;
        String FormatName = "JPEG (Joint Photographic Experts Group) Format";
        String MimeType = "image/jpeg";
        // we ought to count images, but don't yet.
        int NumberOfImages = 1;
        // not accurate ... only reflects first
View Full Code Here

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

        int bitsPerPixel = bhi.bitsPerPixel;
        ImageFormat format = ImageFormat.IMAGE_FORMAT_BMP;
        String name = "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

        // System.out.println("header.Mode: " + header.Mode);
        // System.out.println("getChannelsPerMode(header.Mode): " +
        // getChannelsPerMode(header.Mode));
        if (BitsPerPixel < 0)
            BitsPerPixel = 0;
        ImageFormat Format = ImageFormat.IMAGE_FORMAT_PSD;
        String FormatName = "Photoshop";
        String MimeType = "image/x-photoshop";
        // we ought to count images, but don't yet.
        int NumberOfImages = -1;
        // not accurate ... only reflects first
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

            throw new ImageReadException("PNM: Couldn't read Header");

        ArrayList Comments = new ArrayList();

        int BitsPerPixel = info.getBitDepth() * info.getNumComponents();
        ImageFormat Format = info.getImageType();
        String FormatName = info.getImageTypeDescription();
        String MimeType = info.getMIMEType();
        int NumberOfImages = 1;
        boolean isProgressive = false;

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.