Package com.lightcrafts.image.metadata

Examples of com.lightcrafts.image.metadata.ImageMetadataDirectory


        }
        return "(undefined)";
    }

    public Object getValue(ImageMetadata meta) {
        ImageMetadataDirectory dir = meta.getDirectoryFor(clazz);
        if (dir != null) {
            ImageMetaValue value = dir.getValue(tagID);
            if (value != null) {
                String text = value.toString();
                return text;
            }
        }
View Full Code Here


    public String getLabel(ImageMetadata meta) {
        return LOCALE.get("ExposureLabel");
    }

    public String getValue(ImageMetadata meta) {
        ImageMetadataDirectory dir = meta.getDirectoryFor(CoreDirectory.class);
        ImageMetaValue apertureValue = dir.getValue(CoreTags.CORE_APERTURE);
        ImageMetaValue speedValue = dir.getValue(CoreTags.CORE_SHUTTER_SPEED);
        if ((apertureValue != null) && (speedValue != null)) {
            String value = LOCALE.get(
                "ExposureValue", speedValue.toString(), apertureValue.toString()
            );
            return value;
View Full Code Here

    // information in the File.
    static ImageMetadata getEggMetadata(File file) {

        ImageMetadata meta = new ImageMetadata();

        ImageMetadataDirectory core =
            meta.getDirectoryFor(CoreDirectory.class, true);

        String path = file.getParent();
        if (path == null) {
            path = "";
        }
        ImageMetaValue pathValue = new StringMetaValue(path);
        core.putValue(CORE_DIR_NAME, pathValue);

        String name = file.getName();
        ImageMetaValue nameValue = new StringMetaValue(name);
        core.putValue(CORE_FILE_NAME, nameValue);

        long length = file.length();
        ImageMetaValue lengthValue = new UnsignedLongMetaValue(length);
        core.putValue(CORE_FILE_SIZE, lengthValue);

        long time = file.lastModified();
        ImageMetaValue timeValue = new DateMetaValue(time);
        core.putValue(CORE_FILE_DATE_TIME, timeValue);

        return meta;
    }
View Full Code Here

TOP

Related Classes of com.lightcrafts.image.metadata.ImageMetadataDirectory

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.