Example usage for com.lowagie.text Image ORIGINAL_JPEG2000

List of usage examples for com.lowagie.text Image ORIGINAL_JPEG2000

Introduction

In this page you can find the example usage for com.lowagie.text Image ORIGINAL_JPEG2000.

Prototype

int ORIGINAL_JPEG2000

To view the source code for com.lowagie.text Image ORIGINAL_JPEG2000.

Click Source Link

Document

type of image

Usage

From source file:codes.thischwa.jii.core.iTextImageWrapper.java

License:Apache License

@Override
public void set(File file) throws FileNotFoundException, ReadException {
    if (!file.exists())
        throw new FileNotFoundException("File not found: " + file.getAbsolutePath());
    try {/*from w ww  . ja  va 2s. co m*/
        image = Image.getInstance(file.getAbsolutePath());
    } catch (Exception e) {
        throw new ReadException(e);
    }

    int type = image.getOriginalType();
    switch (type) {
    case Image.ORIGINAL_BMP:
        imageType = ImageType.BMP;
        break;
    case Image.ORIGINAL_GIF:
        imageType = ImageType.GIF;
        break;
    case Image.ORIGINAL_JPEG:
    case Image.ORIGINAL_JPEG2000:
        imageType = ImageType.JPG;
        break;
    case Image.ORIGINAL_PNG:
        imageType = ImageType.PNG;
        break;
    default: {
        logger.warn("Couldn't analyse format from {} or image type isn't supported.", file.getAbsolutePath());
        imageType = null;
    }
    }
}