GroupDocs.Metadata for Java is an advanced metadata fields manipulation solution to easily read, add, modify, delete, search, compare, replace and export metadata information from images and document formats without using any external software. Edit metadata details from Word documents, Excel spreadsheets, PowerPoint presentations, Outlook emails, OneNote, Visio, Project, PDF, AutoCAD, ZIp, Audio and Video file formats along with the support for working with many other metadata processing features.
GroupDocs.Metadata makes it easy for Java developers to get metadata information from JPEG files from within their applications by implementing a few easy steps.
GroupDocs.Metadata for Java APIs are supported on all major platforms and operating systems. Before executing the code below, please make sure that you have the following prerequisites installed on your system.
public class UpdatingMetadata {
public static void run() {
Date threeDaysAgo = new Date(System.currentTimeMillis() - TimeUnit.DAYS.toMillis(3));
try (Metadata metadata = new Metadata("input.jpeg")) {
// Update the file creation date/time if the existing value is older than 3 days
int affected = metadata.updateProperties(new ContainsTagSpecification(Tags.getTime().getCreated()).and(
new OfTypeSpecification(MetadataPropertyType.DateTime)).and(
new UpdatingMetadata().new DateBeforeSpecification(threeDaysAgo)), new PropertyValue(new Date()));
System.out.println(String.format("Affected properties: %s", affected));
metadata.save("output.jpeg");
}
}
// Define your own specifications to filter metadata properties
public class DateBeforeSpecification extends Specification {
public DateBeforeSpecification(Date date) {
setValue(date);
}
public final Date getValue() {
return auto_Value;
}
private void setValue(Date value) {
auto_Value = value;
}
private Date auto_Value;
public boolean isSatisfiedBy(MetadataProperty candidate) {
Date date = candidate.getValue().toClass(Date.class);
if (date != null) {
return date.before(getValue());
}
return false;
}
}
}
Update metadata information of JPEG file right now by visiting GroupDocs.Metadata Live Demos website.
The live demo has the following benefits
No need to download API
No need to write any code
Just upload the source file
Get download link to save the file
A JPEG is a type of image format that is saved using the method of lossy compression. The output image, as result of compression, is a trade-off between storage size and image quality. Users can adjust the compression level to achieve the desired quality level while at the same time reduce the storage size. Image quality is negligibly affected if 10:1 compression is applied to the image. The higher the compression value, the higher the degradation in image quality. JPEG image file format was standardized by the Joint Photographic Experts Group and, hence, the name JPEG. The format has been the choice of storing and transmitting photographic images on the web. Almost all Operating systems now have viewers that support visualization of JPEG images, which are often stored with JPG extension as well. Even the web browsers support visualization of JPEG images.
Read More About JPEG File FormatMulti format documents and images metadata editing API for Java. Get metadata details of some of the popular file formats as stated below.
(Adobe Portable Document Format)
(Microsoft Word Document)
(Microsoft Word Macro-Enabled Document)
(Microsoft Word Open XML Document)
(Microsoft Word Document Template)
(Word Open XML Document Template)
(Microsoft Excel Binary File Format)
(Microsoft Excel Open XML Spreadsheet)
(Microsoft Excel Macro-Enabled Spreadsheet)
(OOXML Macro Enabled Workbook Template)
(PowerPoint Presentation)
(Microsoft PowerPoint Slide Show)
(PowerPoint Open XML Presentation)
(PowerPoint Open XML Slide Show)
(Microsoft PowerPoint Open XML Template)
(Microsoft PowerPoint Template)
(Microsoft PowerPoint Presentation)
(Microsoft PowerPoint Slide Show)
(Open Document Spreadsheet)
(Open Document Text)
(Tagged Image File Format)
(JPEG Image)
(Portable Network Graphic)
(Graphical Interchange Format File)
(Bitmap File Format)
(JPEG 2000 Core Image File)
(Raster Web Image File Format)
(Adobe Photoshop Document)
(Windows Metafile)
(Enhanced Metafile Format)
(Microsoft Project Document)
(Microsoft Outlook E-mail Message)
(E-mail Message)
(Autodesk Design Data Formats)
(AutoCAD Drawing Interchange)
(Microsoft OneNote)
(MPEG Audio Layer III)
(Waveform Audio File Format)
(Digital Imaging & Comm in Medicine)
(Audio Video Interleave File)
(Microsoft Visio 2003-2010 Drawing)
(Microsoft Visio Drawing)
(Microsoft Visio 2003-2010 Stencil)
(Microsoft Visio 2003-2010 XML Drawing)
(Microsoft Visio 2003-2010 XML Stencil)
(Archive File Format)
(Digital E-Book File Format)
(Electronic Business Card)
(vCard)