# Working with metadata in JPEG images ## Reading Photoshop metadata properties The GroupDocs Metadata API allows the user to read Adobe Photoshop metadata associated with a JPEG image. For more information on the Photoshop file format and metadata blocks that can be attached to images of different formats please refer to the specification: [https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/](https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/). The code sample below demonstrates how to extract image resource blocks (building blocks of the Photoshop file format) from a JPEG image. 1. [Load]({{< ref "metadata/java/developer-guide/advanced-usage/loading-files/_index.md" >}}) a JPEG image 2. Get the root metadata package 3. Extract the [ImageResourcePackage](https://reference.groupdocs.com/metadata/java/com.groupdocs.metadata.core/ImageResourcePackage) instance and obtain a list of [ImageResourceBlock](https://reference.groupdocs.com/metadata/java/com.groupdocs.metadata.core/ImageResourceBlock) objects 4. Iterate trough the collection of resource blocks **advanced\_usage.managing\_metadata\_for\_specific\_formats.image.jpeg.JpegReadImageResourceBlocks** ```csharp try (Metadata metadata = new Metadata(Constants.JpegWithIrb)) { JpegRootPackage root = metadata.getRootPackageGeneric(); if (root.getImageResourcePackage() != null) { for (ImageResourceBlock block : root.getImageResourcePackage().toList()) { System.out.println(block.getSignature()); System.out.println(block.getID()); System.out.println(block.getName()); System.out.println(block.getData()); } } } ``` ## Removing Photoshop metadata properties GroupDocs.Metadata for Java also supports removing Photoshop metadata blocks from a JPEG image. Please see the code sample below that demonstrates how to remove the whole Photoshop metadata package from a JPEG image. **advanced\_usage.managing\_metadata\_for\_specific\_formats.image.jpeg.JpegRemoveImageResourceBlocks** ```csharp try (Metadata metadata = new Metadata(Constants.JpegWithIrb)) { JpegRootPackage root = metadata.getRootPackageGeneric(); root.removeImageResourcePackage(); metadata.save(Constants.OutputJpeg); } ``` ## Detecting barcodes in a JPEG image This feature allows you to detect barcodes of different types in a JPEG image. The following code snippet detects all barcodes in a JPEG and return their types. **AdvancedUsage.ManagingMetadataForSpecificFormats.Image.Jpeg.JpegDetectBarcodes** ```csharp try (Metadata metadata = new Metadata(Constants.JpegWithBarcodes)) { JpegRootPackage root = metadata.getRootPackageGeneric(); String[] barcodeTypes = root.detectBarcodeTypes(); for (String barcodeType : barcodeTypes) { System.out.println(barcodeType); } } ``` ## Extracting MakerNote metadata The GroupDocs.Metadata API allows users to read MakerNote properties stored by various camera manufacturers. Please visit the following documentation section for more information: [Extracting MakerNote metadata]({{< ref "metadata/java/developer-guide/advanced-usage/managing-metadata-for-specific-formats/images/working-with-metadata-in-jpeg-images/extracting-makernote-metadata.md" >}}) ## Working with XMP metadata GroupDocs.Metadata for Java allows managing XMP metadata in JPEG images. For more details please refer to the following guide: [Working with XMP Metadata]({{< ref "metadata/java/developer-guide/advanced-usage/working-with-metadata-standards/working-with-xmp-metadata.md" >}}). ## Working with EXIF metadata The GroupDocs.Metadata API supports handling EXIF metadata in JPEG images. Please find appropriate code samples in the [Working with EXIF Metadata]({{< ref "metadata/java/developer-guide/advanced-usage/working-with-metadata-standards/working-with-exif-metadata.md" >}}) section. ## Working with IPTC metadata GroupDocs.Metadata for Java is also able to work with IPTC metadata in JPEG images. Please find more information in the [Working with IPTC IIM Metadata]({{< ref "metadata/java/developer-guide/advanced-usage/working-with-metadata-standards/working-with-iptc-iim-metadata.md" >}}) section. ## More resources ### GitHub examples You may easily run the code above and see the feature in action in our GitHub examples: * [GroupDocs.Metadata for .NET examples](https://github.com/groupdocs-metadata/GroupDocs.Metadata-for-.NET) * [GroupDocs.Metadata for Java examples](https://github.com/groupdocs-metadata/GroupDocs.Metadata-for-Java) ### JPEG metadata management demo App The [JPG Metadata Editing](https://products.groupdocs.app/metadata/jpg) app is available to view and edit metadata of JPEG images, including EXIF, XMP, IPTC, camera settings, GPS location, and other properties. ## Contents - [Extracting MakerNote metadata](https://docs.groupdocs.com/metadata/java/extracting-makernote-metadata.md)