Add Metadata to JPEG in Java

Add metadata properties to JPEG and many other popular documents, images and multimedia file formats using GroupDocs.Metadata for Java API.


Download Free Trial

About GroupDocs.Metadata for Java API

GroupDocs.Metadata for Java is an advanced metadata fields management and manipulation solution to easily view, update, remove, find, compare, exchange and export metadata information from images and document formats without using any external software. Add metadata details to 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.

Steps for adding Metadata to JPEG in Java

GroupDocs.Metadata makes it easy for Java developers to add metadata fields to JPEG files from within their applications by implementing a few easy steps.

  • Load the JPEG file to be updated.
  • Specify a predicate that will be used to add metadata properties.
  • Specify a value which you want to be assigned to the selected properties.
  • Pass the predicate to the AddProperties method.
  • Check the actual number of added properties.
  • Save the changes.

System Requirements

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.

  • Operating Systems: Microsoft Windows, Linux, MacOS
  • Development Environment: NetBeans, Intellij IDEA, Eclipse etc
  • Java Runtime Environment: J2SE 6.0 and above
  • Get the latest version of GroupDocs.Metadata for Java from Maven

// load the file in an instance of Metadata class
try (Metadata metadata = new Metadata("input.jpeg")) {

	// add a property containing the content author
	int affected = metadata.addProperties(new ContainsTagSpecification(Tags.getTime().getPrinted()), new PropertyValue(new Date()));

	System.out.println(String.format("Affected properties: %s", affected));

	metadata.save("output.jpeg");
}

Live Demos to Add Metadata

Add metadata information to 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

About JPEG File Format

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 Format

Adding Metadata Properties To Other File Formats

Java API for adding metadata to multi format documents and images. Set metadata details of some of the popular file formats as stated below.

Add PDF Metadata

(Adobe Portable Document Format)

Add DOC Metadata

(Microsoft Word Document)

Add DOCM Metadata

(Microsoft Word Macro-Enabled Document)

Add DOCX Metadata

(Microsoft Word Open XML Document)

Add DOT Metadata

(Microsoft Word Document Template)

Add DOTX Metadata

(Word Open XML Document Template)

Add XLS Metadata

(Microsoft Excel Binary File Format)

Add XLSX Metadata

(Microsoft Excel Open XML Spreadsheet)

Add XLSM Metadata

(Microsoft Excel Macro-Enabled Spreadsheet)

Add XLTM Metadata

(OOXML Macro Enabled Workbook Template)

Add PPT Metadata

(PowerPoint Presentation)

Add PPS Metadata

(Microsoft PowerPoint Slide Show)

Add PPTX Metadata

(PowerPoint Open XML Presentation)

Add PPSX Metadata

(PowerPoint Open XML Slide Show)

Add POTX Metadata

(Microsoft PowerPoint Open XML Template)

Add POTM Metadata

(Microsoft PowerPoint Template)

Add PPTM Metadata

(Microsoft PowerPoint Presentation)

Add PPSM Metadata

(Microsoft PowerPoint Slide Show)

Add ODS Metadata

(Open Document Spreadsheet)

Add ODT Metadata

(Open Document Text)

Add TIFF Metadata

(Tagged Image File Format)

Add JPEG Metadata

(JPEG Image)

Add PNG Metadata

(Portable Network Graphic)

Add GIF Metadata

(Graphical Interchange Format File)

Add BMP Metadata

(Bitmap File Format)

Add JP2 Metadata

(JPEG 2000 Core Image File)

Add WEBP Metadata

(Raster Web Image File Format)

Add PSD Metadata

(Adobe Photoshop Document)

Add WMF Metadata

(Windows Metafile)

Add EMF Metadata

(Enhanced Metafile Format)

Add MPP Metadata

(Microsoft Project Document)

Add MSG Metadata

(Microsoft Outlook E-mail Message)

Add EML Metadata

(E-mail Message)

Add DWG Metadata

(Autodesk Design Data Formats)

Add DXF Metadata

(AutoCAD Drawing Interchange)

Add ONE Metadata

(Microsoft OneNote)

Add MP3 Metadata

(MPEG Audio Layer III)

Add WAV Metadata

(Waveform Audio File Format)

Add DICOM Metadata

(Digital Imaging & Comm in Medicine)

Add AVI Metadata

(Audio Video Interleave File)

Add VSD Metadata

(Microsoft Visio 2003-2010 Drawing)

Add VSDX Metadata

(Microsoft Visio Drawing)

Add VSS Metadata

(Microsoft Visio 2003-2010 Stencil)

Add VDX Metadata

(Microsoft Visio 2003-2010 XML Drawing)

Add VSX Metadata

(Microsoft Visio 2003-2010 XML Stencil)

Add ZIP Metadata

(Archive File Format)

Add EPUB Metadata

(Digital E-Book File Format)

Add VCF Metadata

(Electronic Business Card)

Back to top
 English