Package com.lightcrafts.image.metadata.values

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


    /**
     * {@inheritDoc}
     */
    public float getShutterSpeed() {
        final ImageMetaValue value = getValue( CANON_SI_EXPOSURE_TIME );
        return value != null ? getShutterSpeedFrom( value ) : 0;
    }
View Full Code Here


     * Create a new {@link ImageMetaValue} having this tag's ID and type.
     *
     * @return Returns said {@link ImageMetaValue}.
     */
    public ImageMetaValue createValue() {
        final ImageMetaValue value = ImageMetaValue.create( m_type );
        value.setIsChangeable( m_isChangeable );
        value.setOwningTagID( m_id );
        return value;
    }
View Full Code Here

        ////////// Core directory

        final ImageMetadataDirectory coreDir =
            metadata.getDirectoryFor( CoreDirectory.class );

        final ImageMetaValue orientation =
            coreDir.getValue( CORE_IMAGE_ORIENTATION );
        if ( orientation != null && (orientation.isEdited() || xmpExists) ) {
            final ImageOrientation xmpOrientation = xmpMetadata != null ?
                xmpMetadata.getOrientation() : ORIENTATION_UNKNOWN;
            modifyMetadata(
                imageInfo, EXIF_ORIENTATION, orientation.getShortValue(),
                xmpOrientation != ORIENTATION_UNKNOWN ?
                    xmpOrientation.getTIFFConstant() : NO_META_VALUE,
                false
            );
            orientation.clearEdited();
        }

        final ImageMetaValue rating = coreDir.getValue( CORE_RATING );
        if ( rating != null && (rating.isEdited() || xmpExists) ) {
            final short xmpRating = xmpMetadata != null ?
                (short)xmpMetadata.getRating() : NO_META_VALUE;
            final short newRating = rating.getShortValue();
            boolean removeRating = false;
            if ( newRating == 0 ) {
                metadata.removeValues( CoreDirectory.class, CORE_RATING );
                metadata.removeValues( SubEXIFDirectory.class, EXIF_MS_RATING );
                removeRating = true;
            }
            modifyMetadata(
                imageInfo, EXIF_MS_RATING, newRating, xmpRating, removeRating
            );
            rating.clearEdited();
        }

        // TODO: must do something about unrating a photo

        ////////// IPTC directory
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public float getAperture() {
        final ImageMetaValue value = getValue( CIFF_SI_FNUMBER );
        return  value != null ?
                (float)MetadataUtil.convertFStopFromAPEX( value.getIntValue() ) : 0;
    }
View Full Code Here

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

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

    /**
     * {@inheritDoc}
     */
    public String getCameraMake( boolean includeModel ) {
        final ImageMetaValue value = getValue( CIFF_MAKE_MODEL );
        if ( value != null ) {
            String makeModel = value.getStringValue();
            final int makeNullPos = makeModel.indexOf( '\0' );
            if ( makeNullPos >= 0 ) {
                if ( includeModel ) {
                    final int modelPos = makeNullPos + 1;
                    int endPos = makeModel.indexOf( '\0', modelPos );
View Full Code Here

     * Gets the camera model only.
     *
     * @return Returns said model or <code>null</code> if unavailable.
     */
    public String getCameraModel() {
        final ImageMetaValue value = getValue( CIFF_MAKE_MODEL );
        if ( value == null )
            return null;
        String makeModel = value.getStringValue();
        final int nullPos = makeModel.indexOf( '\0' );
        if ( nullPos == -1 )
            return null;
        final int modelPos = nullPos + 1;
        int endPos = makeModel.indexOf( '\0', modelPos );
View Full Code Here

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

    /**
     * {@inheritDoc}
     */
    public int getColorTemperature() {
        final ImageMetaValue value = getValue( CIFF_COLOR_TEMPERATURE );
        return value != null ? value.getIntValue() : 0;

    }
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.