Package com.alibaba.simpleimage.io

Examples of com.alibaba.simpleimage.io.ImageInputStream


    }

    public static ImageWrapper readJPEG(InputStream input)
            throws SimpleImageException {
        ImageWrapper img = null;
        ImageInputStream imageStream = null;

        try {
            imageStream = new ImageBitsInputStream(input);
            JPEGDecoder decoder = new JPEGDecoder(imageStream);
View Full Code Here


        compareImage(img.getName(), left, right, ignoreError);
    }

    protected int getQuality(File f) throws Exception {
        FileInputStream in = null;
        ImageInputStream imageStream = null;
        try {
            in = new FileInputStream(f);
            imageStream = new ImageBitsInputStream(in);
            JPEGDecoder decoder = new JPEGDecoder(imageStream, false, false);
            decoder.decode();

            return decoder.getQuality();
        } finally {
            IOUtils.closeQuietly(in);
            if (imageStream != null) {
                imageStream.close();
            }
        }
    }
View Full Code Here

        }
    }

    protected ImageWrapper getDecodedImage(File f) throws Exception {
        FileInputStream in = null;
        ImageInputStream imageStream = null;
        try {
            in = new FileInputStream(f);
            imageStream = new ImageBitsInputStream(in);
            JPEGDecoder decoder = new JPEGDecoder(imageStream, false, false);
            ImageWrapper wi = decoder.decode();

            return wi;
        } finally {
            IOUtils.closeQuietly(in);
            if (imageStream != null) {
                imageStream.close();
            }
        }
    }
View Full Code Here

    protected DecodeFacade getAliDecoder() {
        DecodeFacade d = new DecodeFacade() {

            public BufferedImage decode(InputStream in) throws IOException {
                // FileInputStream in = null;
                ImageInputStream imageStream = null;
                try {
                    // in = new FileInputStream(img);
                    imageStream = new ImageBitsInputStream(in);
                    JPEGDecoder decoder = new JPEGDecoder(imageStream);
                    ImageWrapper wi = decoder.decode();

                    return wi.getAsBufferedImage();
                } finally {
                    // IOUtils.closeQuietly(in);
                    if (imageStream != null) {
                        imageStream.close();
                    }
                }
            }

            public String getName() {
View Full Code Here

TOP

Related Classes of com.alibaba.simpleimage.io.ImageInputStream

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.