Package com.lightcrafts.image.libs

Examples of com.lightcrafts.image.libs.LCJPEGReader


    public Dimension getDimension( ImageInfo imageInfo )
        throws BadImageFileException, IOException, UnknownImageTypeException
    {
        Dimension d = null;
        try {
            LCJPEGReader reader = null;
            try {
                final String path = imageInfo.getFile().getAbsolutePath();
                reader = new LCJPEGReader( path );
                d = new Dimension( reader.getWidth(), reader.getHeight() );
            }
            finally {
                if ( reader != null )
                    reader.dispose();
            }
        }
        catch ( LCImageLibException e ) {
            // ignore
        }
View Full Code Here


            }
            catch ( ColorProfileException e ) {
                profile = null;
            }

            final LCJPEGReader reader = new LCJPEGReader(
                imageInfo.getFile().getAbsolutePath(), maxWidth, maxHeight,
                (JPEGImageInfo)imageInfo.getAuxiliaryInfo()
            );
            final PlanarImage image = reader.getImage(
                thread, profile != null ? new ICC_ColorSpace( profile ) : null
            );

            assert image instanceof CachedImage
                    && image.getTileWidth() == JAIContext.TILE_WIDTH
View Full Code Here

                                                         int maxWidth,
                                                         int maxHeight )
        throws BadImageFileException
    {
        try {
            final LCJPEGReader reader = new LCJPEGReader(
                new InputStreamImageDataProvider( stream ),
                maxWidth, maxHeight
            );
            return reader.getImage( cs );
        }
        catch ( UserCanceledException e ) {
            //
            // This never actually happens.
            //
View Full Code Here

            }

            if (of.getName().endsWith(".jpg") || of.getName().endsWith(".tiff")) {
                if (of.getName().endsWith(".jpg")) {
                    try {
                        LCJPEGReader jpegReader = new LCJPEGReader(of.getPath());
                        result = jpegReader.getImage();
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                } else {
                    try {
View Full Code Here

        try {
            final InputStream in = cache.getStreamFor( key );
            try {
                ImageProviderReceiver provRecv = new ImageProviderReceiver();
                provRecv.fill(in);
                final LCJPEGReader jpeg = new LCJPEGReader(
                    provRecv, PreviewSize, PreviewSize
                );
                return jpeg.getImage();
            }
            finally {
                in.close();
            }
        }
View Full Code Here

TOP

Related Classes of com.lightcrafts.image.libs.LCJPEGReader

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.