---
title: "Adobe Image Resource Blocks"
canonical: https://www.graphicsmill.com/docs/gm/adobe-image-resource-blocks.htm
product: "Graphics Mill"
---

# Adobe Image Resource Blocks
 
This article explains how to work with Adobe image resource blocks in Graphics Mill. For general information about metadata, see the [Working with Metadata](https://www.graphicsmill.com/docs/gm/working-with-metadata.htm.md) topic.
 
The Adobe image resource blocks metadata format consists of independent pieces of structured data. Each data piece has an information type defined and consists of the following fields:
 
- unique identifier
- name
- size of resource data
- resource data

Resource data format depends on the type of an image resource block. You can find a list of supported types and formats in the [Adobe Photoshop File Formats Specification↗](http://www.adobe.com/devnet-apps/photoshop/fileformatashtml/PhotoshopFileFormats.htm).
 
Graphics Mill provides the [AdobeResourceBlock](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_AdobeResourceBlock.htm.md) and [AdobeResourceDictionary](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_AdobeResourceDictionary.htm.md) classes to work with Adobe image resource blocks. The **AdobeResourceBlock** class allows you to store the following information about an image resource block: name, size, and resource data. The class stores resource data as a binary buffer, but does not include tools for resource data manipulation, so you should parse and construct the data by yourself. The **AdobeResourceDictionary** class is a collection of **AdobeResourceBlock** instances. This class is represented by a hash table, which stores instances of the **AdobeResourceBlock** class and provides access to them with unique identifiers. The identifiers are image resource block types and they are defined in the specification.
 
**Note** 
Graphics Mill does not perform any validation of the resource data internal structure while encoding. So, you should provide correctly generated **AdobeResourceBlock** instances. Files containing incorrect Adobe® image resource blocks can produce errors during opening or processing in Adobe® applications.
 
As mentioned above, Graphics Mill supports Adobe Image Resource Blocks metadata for [JPEG](https://www.graphicsmill.com/docs/gm/supported-file-formats.htm.md) and [TIFF](https://www.graphicsmill.com/docs/gm/supported-file-formats.htm.md) files. Each file format has a corresponding image reader, a class from the [Aurigma.GraphicsMill.Codecs](https://www.graphicsmill.com/docs/gm/N_Aurigma_GraphicsMill_Codecs.htm.md) namespace. So, you can use the [JpegReader](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_JpegReader.htm.md) and [TiffReader](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_TiffReader.htm.md) classes to extract metadata. These classes inherit the [ImageReader](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_ImageReader.htm.md) class, which exposes the [AdobeResources](https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Codecs_ImageReader_AdobeResources.htm.md) property. If an image contains Adobe image resource blocks, the property returns **AdobeResourceDictionary** collection storing image resource blocks, otherwise the property returns null.
 
There are two ways to write Adobe image resource blocks. Whichever method you choose, you should prepare an **AdobeResourceDictionary** collection first. The **AdobeResourceBlock** class represents an Adobe resource block. To add a resource block to the collection, use the [MetadataDictionary.Item(Object)](https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Codecs_MetadataDictionary_Item_1_d02429b3.htm.md) property. Then you can set the collection as a value of the [TiffWriter.AdobeResources](https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Codecs_TiffWriter_AdobeResources.htm.md) or [JpegWriter.AdobeResources](https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Codecs_JpegWriter_AdobeResources.htm.md) property. Or you can use the [Bitmap.Save](https://www.graphicsmill.com/docs/gm/O_T_Aurigma_GraphicsMill_Bitmap_Save.htm.md) method and set the collection as a value of the [TiffSettings.AdobeResources](https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Codecs_TiffSettings_AdobeResources.htm.md) or [JpegSettings.AdobeResources](https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Codecs_JpegSettings_AdobeResources.htm.md) property.
 
The following code removes the thumbnail from Adobe image resource blocks and marks the image as copyrighted. Thumbnail block ID is 0x0409 and copyright flag ID is 0x040A.
 
```csharp
using (var reader = new JpegReader(@"Images\in.jpg"))
{
    // Open reader on the file you need to modify metadata for  
    var adobeResources = reader.AdobeResources;
    if (adobeResources == null)
        adobeResources = new AdobeResourceDictionary();

    // Create new adobe image resource block with the required metadata
    var arBlock = new AdobeResourceBlock("Copyright", new byte[] { 1 });
    // Set this block to the item with 0x040A ID (copyright flag)
    adobeResources[0x040A] = arBlock;
    // Remove a block with 0x0409 (thumbnail data)
    adobeResources.Remove(0x0409);

    // Write new image and metadata
    using (var writer = new JpegWriter(@"Images\out.jpg"))
    {
        writer.AdobeResources = adobeResources;
        Pipeline.Run(reader + writer);
    }
}
```
 
## See Also
  
### Reference
 
- [AdobeResourceBlock Class](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_AdobeResourceBlock.htm.md)
- [AdobeResourceDictionary Class](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_AdobeResourceDictionary.htm.md)
- [MetadataDictionary Class](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_MetadataDictionary.htm.md)
- [ImageReader.AdobeResources Property](https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Codecs_ImageReader_AdobeResources.htm.md)
- [JpegWriter.AdobeResources Property](https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Codecs_JpegWriter_AdobeResources.htm.md)
- [TiffWriter.AdobeResources Property](https://www.graphicsmill.com/docs/gm/P_Aurigma_GraphicsMill_Codecs_TiffWriter_AdobeResources.htm.md)
- [JpegSettings Class](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_JpegSettings.htm.md)
- [TiffSettings Class](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Codecs_TiffSettings.htm.md)

### Manual
 
- [Working with Metadata](https://www.graphicsmill.com/docs/gm/working-with-metadata.htm.md)
- [Preserving Metadata while Processing Images](https://www.graphicsmill.com/docs/gm/preserving-metadata-while-processing-images.htm.md)

### Other
 
- [Adobe Photoshop File Formats Specification↗](http://www.adobe.com/devnet-apps/photoshop/fileformatashtml/PhotoshopFileFormats.htm)
