←Select platform

ReadMarkers(string) Method

Summary
Reads all the metadata markers (COM and APPn) from a file.
Syntax
C#
Objective-C
C++/CLI
Python
public IList<RasterMarkerMetadata> ReadMarkers( 
   string fileName 
) 
- (nullable NSArray<LTRasterMarkerMetadata *> *)readMarkersFromFile:(NSString *)file error:(NSError **)error 
public: 
IList<RasterMarkerMetadata^>^ ReadMarkers(  
   String^ fileName 
)  
def ReadMarkers(self,fileName): 

Parameters

fileName
A String containing the input file name.

Return Value

A collection of RasterMarkerMetadata objects containing the metadata marker data.

Remarks

This method reads all the metadata markers from a file, and returns a collection of the markers.

Typically, JPEG and Exif JPEG files contain markers. You can call RasterCodecs.MarkersSupported to find out if a certain file format supports markers.

For Exif files, this metadata collection will contain all the Exif and GPS comments, stored in APP1. It will also contain the audio information stored in APP2.

The marker data will typically start with a string identifying the type of data present in the marker. For example, the APP1 Exif marker will usually start with "Exif" followed by 2 bytes of 0x00. That is because there can be many types of data stored in an APP1 marker. This simple convention is a good way of distinguishing between an Exif APP1 marker and another type of APP1 marker.

If the file contains no marker, then this method will return an empty collection.

Example

This example will read all the markers from an EXIF file.

C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing; 
using Leadtools.ImageProcessing.Color; 
using Leadtools.Svg; 
 
 
void ReadMarkersFromFileExample(string exifFileName) 
{ 
   RasterCodecs codecs = new RasterCodecs(); 
 
   IList<RasterMarkerMetadata> markers = codecs.ReadMarkers(exifFileName); 
   Debug.WriteLine("{0} markers found with the following ID's:", markers.Count); 
   foreach (RasterMarkerMetadata marker in markers) 
      Debug.WriteLine(marker.Id); 
 
   codecs.Dispose(); 
} 
Requirements

Target Platforms

Help Version 22.0.2023.5.5
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Codecs Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.