/** * Sets the value of a particular exif tag by name. */ public void setExifTagValue(String name, String value) { ExifTag tag = getExifTag(name); if (tag != null) { removeRepeatingExtension(tag); } if (value != null) { addRepeatingExtension(new ExifTag(name, value)); } }
/** * @return the make of the camera, i.e. Nikon, Canon, Sony. */ public String getCameraMake() { return getExifTagValue("make"); }
/** * Gets the exif tags as a collection of {@link ExifTag}. */ public Collection<ExifTag> getExifTags() { return getRepeatingExtension(ExifTag.class); }
/** * Set the model of the camera used. */ public void setCameraModel(String model) { setExifTagValue("model", model); }
@Override @SuppressWarnings("deprecation") public void declareExtensions(ExtensionProfile extProfile) { super.declareExtensions(extProfile); declare(extProfile, PheedThumbnail.getDefaultDescription()); declare(extProfile, PheedImageUrl.getDefaultDescription()); declare(extProfile, GphotoVersion.getDefaultDescription(false, false)); declare(extProfile, GphotoPosition.getDefaultDescription(false, false)); declare(extProfile, GphotoWidth.getDefaultDescription(false, false)); declare(extProfile, GphotoHeight.getDefaultDescription(false, false)); declare(extProfile, GphotoRotation.getDefaultDescription(false, false)); declare(extProfile, GphotoSize.getDefaultDescription(false, false)); declare(extProfile, GphotoAlbumId.getDefaultDescription(false, false)); declare(extProfile, GphotoAccess.getDefaultDescription(false, false)); declare(extProfile, GphotoClient.getDefaultDescription(false, false)); declare(extProfile, GphotoChecksum.getDefaultDescription(false, false)); declare(extProfile, GphotoTimestamp.getDefaultDescription(false, false)); declare(extProfile, GphotoStreamId.getDefaultDescription(false, false)); declare(extProfile, GphotoVideoStatus.getDefaultDescription(false, false)); declare(extProfile, ExifTags.getDefaultDescription()); new ExifTags().declareExtensions(extProfile); declare(extProfile, GphotoCommentsEnabled.getDefaultDescription(false, false)); declare(extProfile, GphotoCommentCount.getDefaultDescription(false, false)); pointData.declareExtensions(extProfile); boundingBoxData.declareExtensions(extProfile); mediaData.declareExtensions(extProfile); }
"http://schemas.google.com/photos/exif/2007"), "tags", false, false, false)); new ExifTags().declareExtensions(extProfile); extProfile.declare(PhotoEntry.class, GphotoFeaturedDate.class); extProfile.declare(PhotoEntry.class,
/** * Get a particular exif tag by name. This will retrieve the proper exif * tag based on the name. */ public ExifTag getExifTag(String exifName) { Collection<ExifTag> tags = getExifTags(); for (ExifTag tag : tags) { if (tag.getName().equals(exifName)) { return tag; } } return null; }
/** * Gets the value of a particular exif tag, or null if it doesn't exist. */ public String getExifTagValue(String exifName) { ExifTag tag = getExifTag(exifName); return tag == null ? null : tag.getValue(); }
@Override public XmlParser.ElementHandler getChildHandler(String namespace, String localName, Attributes attrs) throws ParseException, IOException { if (Namespaces.EXIF.equals(namespace)) { ExifTag field = new ExifTag(localName); addRepeatingExtension(field); return field.getHandler(extProfile, namespace, localName, attrs); } return getExtensionHandler(extProfile, ExifTags.class, namespace, localName, attrs); } };
/** * Set the model of the camera used. */ public void setCameraModel(String model) { setExifTagValue("model", model); }
@Override @SuppressWarnings("deprecation") public void declareExtensions(ExtensionProfile extProfile) { super.declareExtensions(extProfile); declare(extProfile, PheedThumbnail.getDefaultDescription()); declare(extProfile, PheedImageUrl.getDefaultDescription()); declare(extProfile, GphotoVersion.getDefaultDescription(false, false)); declare(extProfile, GphotoPosition.getDefaultDescription(false, false)); declare(extProfile, GphotoWidth.getDefaultDescription(false, false)); declare(extProfile, GphotoHeight.getDefaultDescription(false, false)); declare(extProfile, GphotoRotation.getDefaultDescription(false, false)); declare(extProfile, GphotoSize.getDefaultDescription(false, false)); declare(extProfile, GphotoAlbumId.getDefaultDescription(false, false)); declare(extProfile, GphotoAccess.getDefaultDescription(false, false)); declare(extProfile, GphotoClient.getDefaultDescription(false, false)); declare(extProfile, GphotoChecksum.getDefaultDescription(false, false)); declare(extProfile, GphotoTimestamp.getDefaultDescription(false, false)); declare(extProfile, GphotoStreamId.getDefaultDescription(false, false)); declare(extProfile, GphotoVideoStatus.getDefaultDescription(false, false)); declare(extProfile, ExifTags.getDefaultDescription()); new ExifTags().declareExtensions(extProfile); declare(extProfile, GphotoCommentsEnabled.getDefaultDescription(false, false)); declare(extProfile, GphotoCommentCount.getDefaultDescription(false, false)); pointData.declareExtensions(extProfile); boundingBoxData.declareExtensions(extProfile); mediaData.declareExtensions(extProfile); }
"http://schemas.google.com/photos/exif/2007"), "tags", false, false, false)); new ExifTags().declareExtensions(extProfile); extProfile.declare(PhotoEntry.class, GphotoFeaturedDate.class); extProfile.declare(PhotoEntry.class,
/** * Get a particular exif tag by name. This will retrieve the proper exif * tag based on the name. */ public ExifTag getExifTag(String exifName) { Collection<ExifTag> tags = getExifTags(); for (ExifTag tag : tags) { if (tag.getName().equals(exifName)) { return tag; } } return null; }
/** * Gets the value of a particular exif tag, or null if it doesn't exist. */ public String getExifTagValue(String exifName) { ExifTag tag = getExifTag(exifName); return tag == null ? null : tag.getValue(); }
@Override public XmlParser.ElementHandler getChildHandler(String namespace, String localName, Attributes attrs) throws ParseException, IOException { if (Namespaces.EXIF.equals(namespace)) { ExifTag field = new ExifTag(localName); addRepeatingExtension(field); return field.getHandler(extProfile, namespace, localName, attrs); } return getExtensionHandler(extProfile, ExifTags.class, namespace, localName, attrs); } };
/** * Set the make of the camera used. */ public void setCameraMake(String make) { setExifTagValue("make", make); }
/** * @return the model of the camera used. */ public String getCameraModel() { return getExifTagValue("model"); }
/** * Sets the value of a particular exif tag by name. */ public void setExifTagValue(String name, String value) { ExifTag tag = getExifTag(name); if (tag != null) { removeRepeatingExtension(tag); } if (value != null) { addRepeatingExtension(new ExifTag(name, value)); } }
@Override public void generate(XmlWriter w, ExtensionProfile extProfile) throws IOException { w.startElement(Namespaces.EXIF_NAMESPACE, "tags", null, null); Collection<ExifTag> fields = getExifTags(); for (ExifTag field : fields) { field.generate(w, extProfile); } w.endElement(); }
/** * Gets the exif tags as a collection of {@link ExifTag}. */ public Collection<ExifTag> getExifTags() { return getRepeatingExtension(ExifTag.class); }