API Reference
OfficeImageMetadata
Portable image metadata with typed Exif edits and independently owned profile bytes.
Inheritance
- Object
- OfficeImageMetadata
Remarks
Metadata edits do not apply ICC color transformations to image pixels. Use [[cref:OfficeIMO.Drawing.OfficeImageMetadata.Apply(System.Byte[],OfficeIMO.Drawing.OfficeImageMetadata,System.Threading.CancellationToken)]] to replace supported container metadata without recompressing image data.
Usage
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by
Accepted by parameters
Constructors
public OfficeImageMetadata() #Methods
public static Byte[] Apply(Byte[] encodedBytes, OfficeImageMetadata metadata, CancellationToken cancellationToken = default) #Byte[]Replaces supported primary-image profiles and density without recompressing image pixels.
Parameters
- encodedBytes System.Byte[]
- metadata OfficeIMO.Drawing.OfficeImageMetadata
- cancellationToken System.Threading.CancellationToken = default
public Void ClearExif() #VoidRemoves the entire Exif profile, including opaque and thumbnail data.
public OfficeImageMetadata Clone() #OfficeImageMetadataCreates an independent copy of profiles, typed fields, pending edits, and TIFF preservation constraints.
public Byte[] EncodeExifProfile() #Byte[]Returns a classic TIFF profile containing the current edits, or null when Exif is absent.
public Byte[] EncodeExifProfile(CancellationToken cancellationToken) #Byte[]Encodes classic TIFF Exif metadata while observing cancellation during directory and value processing.
Parameters
- cancellationToken System.Threading.CancellationToken
public OfficeExifValue GetExifValue(OfficeExifTag tag) #OfficeExifValueReturns a typed field, or null when absent.
Parameters
- tag OfficeIMO.Drawing.OfficeExifTag
public static OfficeImageMetadata ParseExifProfile(Byte[] profile) #OfficeImageMetadataReads a classic TIFF Exif profile or a JPEG-prefixed Exif profile.
Parameters
- profile System.Byte[]
public static OfficeImageMetadata ParseExifProfile(Byte[] profile, CancellationToken cancellationToken) #OfficeImageMetadataReads classic TIFF or JPEG-prefixed Exif metadata while observing cancellation.
Parameters
- profile System.Byte[]
- cancellationToken System.Threading.CancellationToken
public OfficeImageMetadata PrepareForEncoding(OfficeImageFormat format, out OfficeImageMetadataProfileKinds omittedProfiles) #OfficeImageMetadataCreates an independent metadata copy containing only profile families carried by the destination format.
Parameters
- format OfficeIMO.Drawing.OfficeImageFormat
- The destination image container.
- omittedProfiles OfficeIMO.Drawing.OfficeImageMetadataProfileKinds@
- Profile families present in this metadata that the destination cannot carry.
Returns
An independent metadata copy suitable for the destination's supported profile families.
public static OfficeImageMetadata Read(Byte[] encodedBytes, CancellationToken cancellationToken = default) #OfficeImageMetadataReads image profiles and physical resolution from a supported encoded image.
Parameters
- encodedBytes System.Byte[]
- cancellationToken System.Threading.CancellationToken = default
public static OfficeImageMetadataRemovalResult Remove(Byte[] encodedBytes, OfficeImageMetadataProfileKinds kinds, CancellationToken cancellationToken = default) #OfficeImageMetadataRemovalResultRemoves selected supported profile families while preserving encoded image payloads, frame timing, and TIFF pages.
Parameters
- encodedBytes System.Byte[]
- kinds OfficeIMO.Drawing.OfficeImageMetadataProfileKinds
- cancellationToken System.Threading.CancellationToken = default
public Boolean RemoveExifValue(OfficeExifTag tag) #BooleanRemoves a field and returns whether it was present.
Parameters
- tag OfficeIMO.Drawing.OfficeExifTag
public Void SetExifValue(OfficeExifTag tag, Object value) #VoidSets an Exif scalar, text, rational, or typed array using the tag's representation.
Parameters
- tag OfficeIMO.Drawing.OfficeExifTag
- value System.Object
Inherited Methods
Properties
public Double HorizontalResolution { get; set; } #Horizontal resolution in ResolutionUnits.
public Double VerticalResolution { get; set; } #Vertical resolution in ResolutionUnits.
public OfficeImageResolutionUnit ResolutionUnits { get; set; } #The unit for both resolution values.
public OfficeImageResolution Resolution { get; } #An immutable snapshot of the native resolution values, suitable for encoder overrides.
public Nullable<Double> PhysicalDpiX { get; } #Horizontal physical resolution in dots per inch, or null for a unitless aspect ratio.
public Nullable<Double> PhysicalDpiY { get; } #Vertical physical resolution in dots per inch, or null for a unitless aspect ratio.
public Boolean HasExifProfile { get; } #Whether any Exif fields or an opaque Exif profile are present.
public Boolean RequiresOriginalTiffContainer { get; } #Whether TIFF-relative opaque fields require their original TIFF container for safe preservation.
public Byte[] ExifProfile { get; set; } #Classic TIFF Exif profile without a JPEG Exif prefix. Setting a profile replaces all pending Exif edits.
public Byte[] XmpProfile { get; set; } #XMP XML packet, excluding container framing. Profile arrays are copied.
public Byte[] IccProfile { get; set; } #ICC profile bytes. Profile arrays are copied.
public Byte[] IptcProfile { get; set; } #IPTC IIM data, excluding Photoshop resource framing. Profile arrays are copied.
public IReadOnlyList<OfficeExifValue> ExifValues { get; } #Current Exif values from the image, camera, GPS, and interoperability directories.