Package com.alibaba.simpleimage

Examples of com.alibaba.simpleimage.ImageRender


     * .
     */

    public void testScaleRenderInputStreamScaleParameter() throws Exception {
        InputStream input = null;
        ImageRender sr = null;
        try {
            input = new FileInputStream(path.getCanonicalFile() + File.separator + "snow.jpg");
            sr = new ScaleRender(input, getParam());
            write(sr);
        } finally {
            if (sr != null) {
                sr.dispose();
            }
            IOUtils.closeQuietly(input);
        }
    }
View Full Code Here


     * {@link com.alibaba.simpleimage.render.ScaleRender#ScaleRender(java.io.InputStream, boolean, com.alibaba.simpleimage.render.ScaleParameter)}
     * .
     */
    public void testScaleRenderInputStreamBooleanScaleParameter() throws Exception {
        InputStream input = null;
        ImageRender sr = null;
        try {
            input = new FileInputStream(path.getCanonicalFile() + File.separator + "snow.jpg");
            sr = new ScaleRender(input, true, getParam());
            write(sr);
        } finally {
            if (sr != null) {
                sr.dispose();
            }
            IOUtils.closeQuietly(input);
        }
    }
View Full Code Here

    }

    private void doScale(File in, File out, ScaleParameter scaleParam, ImageFormat format, boolean toRGB) throws Exception {
        FileInputStream inStream = null;
        FileOutputStream outStream = null;
        ImageRender wr = null;
        try {
            inStream = new FileInputStream(in);
            outStream = new FileOutputStream(out);
            ImageRender rr = new ReadRender(inStream, toRGB);
            ImageRender sr = new ScaleRender(rr, scaleParam);
            wr = new WriteRender(sr, outStream, format);
            wr.render();
        } finally {
            IOUtils.closeQuietly(inStream);
            IOUtils.closeQuietly(outStream);
View Full Code Here

TOP

Related Classes of com.alibaba.simpleimage.ImageRender

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.