Package com.lightcrafts.image.metadata.values

Examples of com.lightcrafts.image.metadata.values.ImageMetaValue


                return;
        }

        if ( byteCount > DIRECTORY_ENTRY_MAX_SANE_SIZE )
            return;
        final ImageMetaValue value = m_exifParser.parseValue(
            tagID, fieldType, valueOffset, numValues
        );
        if ( value != null )
            try {
                dir.putValue( tagID, value );
View Full Code Here


                case EXIF_YCBCR_POSITIONING:
                case EXIF_YCBCR_SUBSAMPLING:
                case EXIF_Y_RESOLUTION:
                    continue;
                default:
                    final ImageMetaValue toValue = toDir.getValue( tagID );
                    if ( toValue == null )
                        toDir.putValue( tagID, me.getValue() );
            }
        }
    }
View Full Code Here

    {
        final ImageMetadata metadata = imageInfo.getMetadata();
        final ImageMetadataDirectory dir =
            metadata.getDirectoryFor( CIFFDirectory.class );
        if ( dir != null ) {
            final ImageMetaValue colorSpace = dir.getValue( CIFF_COLOR_SPACE );
            ColorSpace cs = JAIContext.sRGBColorSpace;
            if ( colorSpace != null )
                switch ( colorSpace.getIntValue() ) {
                    case CIFF_COLOR_SPACE_ADOBE_RGB:
                        cs = JAIContext.adobeRGBColorSpace;
                        break;
                }
            final RenderedImage image = JPEGImageType.getImageFromBuffer(
View Full Code Here

        // We have to redo a lot of what createWritableRasterFrom() does here
        // so we can get a hold of the buffer and change the fist byte back to
        // FF.  Because we have to modify it, it can't be a FileByteBuffer, so
        // we have to copy it into an ArrayByteBuffer.
        //
        final ImageMetaValue offsetValue =
            dir.getValue( MINOLTA_PREVIEW_IMAGE_START );
        final ImageMetaValue lengthValue =
            dir.getValue( MINOLTA_PREVIEW_IMAGE_LENGTH );
        if ( offsetValue == null || lengthValue == null )
            return null;
        final int offset = offsetValue.getIntValue();
        final int length = lengthValue.getIntValue();
        if ( offset <= 0 || length <= 0 )
            return null;
        //
        // To conserve resources, we reuse an ArrayByteBuffer used during the
        // reading of metadata and stored in MRWImageInfo.
View Full Code Here

     */
    private static ICC_Profile getICCProfileFromEXIF( ImageInfo imageInfo )
        throws BadImageFileException, IOException
    {
        try {
            final ImageMetaValue colorSpace =
                imageInfo.getMetadata().getValue(
                    EXIFDirectory.class, EXIF_COLOR_SPACE
                );
            if ( colorSpace != null )
                switch ( colorSpace.getIntValue() ) {
                    case 1:     // sRGB
                        return JAIContext.sRGBColorProfile;
                    default:    // uncalibrated or something else
                        return JAIContext.adobeRGBProfile;
                }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public float getAperture() {
        ImageMetaValue value = getValue( TIFF_FNUMBER );
        if ( value == null )
            value = getValue( TIFF_APERTURE_VALUE );
        if ( !(value instanceof RationalMetaValue) )
              return 0;
        return MetadataUtil.fixFStop( value.getFloatValue() );
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public String getArtist() {
        final ImageMetaValue value = getValue( TIFF_ARTIST );
        return value != null ? value.getStringValue() : null;
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public int getBitsPerChannel() {
        final ImageMetaValue value = getValue( TIFF_BITS_PER_SAMPLE );
        return value != null ? value.getIntValue() : 0;
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public String getCaption() {
        final ImageMetaValue value = getValue( TIFF_IMAGE_DESCRIPTION );
        return value != null ? value.getStringValue() : null;
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public Date getCaptureDateTime() {
        final ImageMetaValue value = getValue( TIFF_DATE_TIME );
        return  value instanceof DateMetaValue ?
                ((DateMetaValue)value).getDateValue() : null;
    }
View Full Code Here

TOP

Related Classes of com.lightcrafts.image.metadata.values.ImageMetaValue

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.