Package org.apache.xmlgraphics.image.codec.util

Examples of org.apache.xmlgraphics.image.codec.util.SeekableStream


        Source src = session.needSource(info.getOriginalURI());
        ImageInputStream in = ImageUtil.needImageInputStream(src);
        in.mark();
        try {
            SeekableStream seekable = new SeekableStreamAdapter(in);
            dir = new TIFFDirectory(seekable, 0);
            TIFFField fld;

            fld = dir.getField(TIFFImageDecoder.TIFF_COMPRESSION);
            if (fld != null) {
View Full Code Here


public class CodecResourcesTest extends TestCase {

    public void testResources() throws Exception {

        InputStream in = new java.io.FileInputStream("test/images/barcode.eps");
        SeekableStream seekStream = new MemoryCacheSeekableStream(in);
        try {
            new PNGImage(seekStream, null);
            fail("Exception expected");
        } catch (RuntimeException re) {
            String msg = re.getMessage();
View Full Code Here

        Source src = session.needSource(info.getOriginalURI());
        ImageInputStream in = ImageUtil.needImageInputStream(src);
        // Remove streams as we do things with them at some later time.
        ImageUtil.removeStreams(src);
        SeekableStream seekStream = new ImageInputStreamSeekableStreamAdapter(in);
        PNGFile im = new PNGFile(seekStream);
        ImageRawPNG irpng = im.getImageRawPNG(info);
        return irpng;
    }
View Full Code Here

            IOException {

        Source src = session.needSource(info.getOriginalURI());
        ImageInputStream imgStream = ImageUtil.needImageInputStream(src);

        SeekableStream seekStream = new ImageInputStreamSeekableStreamAdapter(imgStream);

        PNGImageDecoder decoder = new PNGImageDecoder(seekStream, new PNGDecodeParam());
        RenderedImage image = decoder.decodeAsRenderedImage();

        // need transparency here?
View Full Code Here

            throws ImageException, IOException {

        Source src = session.needSource(info.getOriginalURI());
        ImageInputStream imgStream = ImageUtil.needImageInputStream(src);

        SeekableStream seekStream = new ImageInputStreamSeekableStreamAdapter(imgStream);
        try {
            org.apache.xmlgraphics.image.codec.tiff.TIFFImage img
                = new org.apache.xmlgraphics.image.codec.tiff.TIFFImage
                    (seekStream, null, 0);
            // TODO: This may ignore ICC Profiles stored in TIFF images.
View Full Code Here

        ImageInfo info = null;
        in.mark();
        try {
            int pageIndex = ImageUtil.needPageIndexFromURI(uri);

            SeekableStream seekable = new SeekableStreamAdapter(in);
            TIFFDirectory dir;
            try {
                dir = new TIFFDirectory(seekable, pageIndex);
            } catch (IllegalArgumentException iae) {
                String errorMessage = MessageFormat.format(
View Full Code Here

        ImageInfo info = null;
        in.mark();
        try {
            int pageIndex = ImageUtil.needPageIndexFromURI(uri);
           
            SeekableStream seekable = new SeekableStreamAdapter(in);
            TIFFDirectory dir;
            try {
                dir = new TIFFDirectory(seekable, pageIndex);
            } catch (IllegalArgumentException iae) {
                String errorMessage = MessageFormat.format(
View Full Code Here

       
        Source src = session.needSource(info.getOriginalURI());
        ImageInputStream in = ImageUtil.needImageInputStream(src);
        in.mark();
        try {
            SeekableStream seekable = new SeekableStreamAdapter(in);
            dir = new TIFFDirectory(seekable, 0);
            TIFFField fld;
           
            fld = dir.getField(TIFFImageDecoder.TIFF_COMPRESSION);
            if (fld != null) {
View Full Code Here

public class CodecResourcesTest extends TestCase {

    public void testResources() throws Exception {

        InputStream in = new java.io.FileInputStream("test/images/barcode.eps");
        SeekableStream seekStream = new MemoryCacheSeekableStream(in);
        try {
            new PNGImage(seekStream, null);
            fail("Exception expected");
        } catch (RuntimeException re) {
            String msg = re.getMessage();
View Full Code Here

            throws ImageException, IOException {

        Source src = session.needSource(info.getOriginalURI());
        ImageInputStream imgStream = ImageUtil.needImageInputStream(src);

        SeekableStream seekStream = new ImageInputStreamSeekableStreamAdapter(imgStream);
        org.apache.xmlgraphics.image.codec.tiff.TIFFImage img
            = new org.apache.xmlgraphics.image.codec.tiff.TIFFImage
                (seekStream, null, 0);
        // TODO: This may ignore ICC Profiles stored in TIFF images.
        return new ImageRendered(info, img, null);
View Full Code Here

TOP

Related Classes of org.apache.xmlgraphics.image.codec.util.SeekableStream

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.