Examples of LCByteBuffer


Examples of com.lightcrafts.utils.bytebuffer.LCByteBuffer

     */
    public RenderedImage getPreviewImage( ImageInfo imageInfo, int maxWidth,
                                          int maxHeight )
        throws BadImageFileException, IOException
    {
        final LCByteBuffer buf = imageInfo.getByteBuffer();
        //
        // The pointer to where the JPEG starts is 84 bytes in.  The length of
        // the JPEG is 4 bytes after that.  Both are always in big-endian.
        //
        final ByteOrder origOrder = buf.order();
        buf.order( ByteOrder.BIG_ENDIAN );
        final int offset = buf.getInt( 84 );
        final int length = buf.getInt( 88 );
        buf.order( origOrder );
        return JPEGImageType.getImageFromBuffer(
            buf, offset, length, null, 0, 0
        );
    }
View Full Code Here

Examples of com.lightcrafts.utils.bytebuffer.LCByteBuffer

     * {@inheritDoc}
     */
    public ImageType getTrueImageTypeOf( ImageInfo imageInfo )
        throws IOException
    {
        final LCByteBuffer buf = imageInfo.getByteBuffer();
        try {
            buf.position( 12 );
            if ( buf.getEquals( "Raw", "ASCII" ) ) {
                final ImageMetadata metadata = imageInfo.getCurrentMetadata();
                MetadataUtil.removePreviewMetadataFrom( metadata );
                MetadataUtil.removeWidthHeightFrom( metadata );
                return PhaseOneTIFFRawImageType.INSTANCE;
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.