Show / Hide Table of Contents

Class ImageFile

Represents the base class for image files.

Inheritance
System.Object
ImageFile
GIFFile
JPEGFile
PNGFile
TIFFFile
Namespace: ExifLibrary
Assembly: ExifLibrary.dll
Syntax
public abstract class ImageFile

Constructors

| Improve this Doc View Source

ImageFile()

Initializes a new instance of the ImageFile class.

Declaration
protected ImageFile()

Properties

| Improve this Doc View Source

Encoding

Gets the encoding used for text metadata when the source encoding is unknown.

Declaration
public Encoding Encoding { get; protected set; }
Property Value
Type Description
System.Text.Encoding
| Improve this Doc View Source

Errors

Gets the errors encountered while reading/writing the image file.

Declaration
public List<ImageError> Errors { get; protected set; }
Property Value
Type Description
System.Collections.Generic.List<ImageError>
| Improve this Doc View Source

Format

Returns the format of the ImageFile.

Declaration
public ImageFileFormat Format { get; protected set; }
Property Value
Type Description
ImageFileFormat
| Improve this Doc View Source

Item[Int32]

Gets or sets the Exif property with the given key.

Declaration
public ExifProperty this[int index] { get; set; }
Parameters
Type Name Description
System.Int32 index
Property Value
Type Description
ExifProperty
| Improve this Doc View Source

Properties

Gets the collection of Exif properties contained in the ImageFile.

Declaration
public ExifPropertyCollection<ExifProperty> Properties { get; }
Property Value
Type Description
ExifPropertyCollection<ExifProperty>
| Improve this Doc View Source

Thumbnail

Gets or sets the embedded thumbnail image.

Declaration
public byte[] Thumbnail { get; set; }
Property Value
Type Description
System.Byte[]

Methods

| Improve this Doc View Source

Crush()

Decreases file size by removing all metadata.

Declaration
public abstract void Crush()
| Improve this Doc View Source

FromBuffer(Byte[])

Creates an ImageFile from the specified data.

Declaration
public static ImageFile FromBuffer(byte[] imageData)
Parameters
Type Name Description
System.Byte[] imageData

A buffer containing image data.

Returns
Type Description
ImageFile

The ImageFile created from the buffer.

| Improve this Doc View Source

FromBuffer(Byte[], Encoding)

Creates an ImageFile from the specified data.

Declaration
protected static ImageFile FromBuffer(byte[] imageData, Encoding encoding)
Parameters
Type Name Description
System.Byte[] imageData

A buffer containing image data.

System.Text.Encoding encoding

The encoding to be used for text metadata when the source encoding is unknown.

Returns
Type Description
ImageFile

The ImageFile created from the buffer.

| Improve this Doc View Source

FromFile(String)

Creates an ImageFile from the specified file.

Declaration
public static ImageFile FromFile(string filename)
Parameters
Type Name Description
System.String filename

A string that contains the name of the file.

Returns
Type Description
ImageFile

The ImageFile created from the file.

| Improve this Doc View Source

FromFile(String, Encoding)

Creates an ImageFile from the specified file.

Declaration
public static ImageFile FromFile(string filename, Encoding encoding)
Parameters
Type Name Description
System.String filename

A string that contains the name of the file.

System.Text.Encoding encoding

The encoding to be used for text metadata when the source encoding is unknown.

Returns
Type Description
ImageFile

The ImageFile created from the file.

| Improve this Doc View Source

FromFileAsync(String)

Creates an ImageFile from the specified file by asynchronously reading image data.

Declaration
public static Task<ImageFile> FromFileAsync(string filename)
Parameters
Type Name Description
System.String filename

A string that contains the name of the file.

Returns
Type Description
System.Threading.Tasks.Task<ImageFile>

The ImageFile created from the file.

| Improve this Doc View Source

FromFileAsync(String, Encoding)

Creates an ImageFile from the specified file while while asynchronously reading image data.

Declaration
public static Task<ImageFile> FromFileAsync(string filename, Encoding encoding)
Parameters
Type Name Description
System.String filename

A string that contains the name of the file.

System.Text.Encoding encoding

The encoding to be used for text metadata when the source encoding is unknown.

Returns
Type Description
System.Threading.Tasks.Task<ImageFile>

The ImageFile created from the file.

| Improve this Doc View Source

FromStream(Stream)

Creates an ImageFile from the specified data stream.

Declaration
public static ImageFile FromStream(Stream stream)
Parameters
Type Name Description
System.IO.Stream stream

A stream that contains image data.

Returns
Type Description
ImageFile

The ImageFile created from the stream.

| Improve this Doc View Source

FromStream(Stream, Encoding)

Creates an ImageFile from the specified data stream.

Declaration
protected static ImageFile FromStream(Stream stream, Encoding encoding)
Parameters
Type Name Description
System.IO.Stream stream

A stream that contains image data.

System.Text.Encoding encoding

The encoding to be used for text metadata when the source encoding is unknown.

Returns
Type Description
ImageFile

The ImageFile created from the stream.

| Improve this Doc View Source

FromStreamAsync(Stream)

Creates an ImageFile from the specified data stream by asynchronously reading image data.

Declaration
public static Task<ImageFile> FromStreamAsync(Stream stream)
Parameters
Type Name Description
System.IO.Stream stream

A stream that contains image data.

Returns
Type Description
System.Threading.Tasks.Task<ImageFile>

The ImageFile created from the stream.

| Improve this Doc View Source

FromStreamAsync(Stream, Encoding)

Creates an ImageFile from the specified data stream by asynchronously reading image data.

Declaration
public static Task<ImageFile> FromStreamAsync(Stream stream, Encoding encoding)
Parameters
Type Name Description
System.IO.Stream stream

A stream that contains image data.

System.Text.Encoding encoding

The encoding to be used for text metadata when the source encoding is unknown.

Returns
Type Description
System.Threading.Tasks.Task<ImageFile>

The ImageFile created from the stream.

| Improve this Doc View Source

FromStreamInternal(MemoryStream, Encoding)

Creates an ImageFile from the specified data stream.

Declaration
protected static ImageFile FromStreamInternal(MemoryStream stream, Encoding encoding)
Parameters
Type Name Description
System.IO.MemoryStream stream

A stream that contains image data.

System.Text.Encoding encoding

The encoding to be used for text metadata when the source encoding is unknown.

Returns
Type Description
ImageFile

The ImageFile created from the file.

| Improve this Doc View Source

Save(Stream)

Asynchronously saves the ImageFile to the specified stream.

Declaration
public void Save(Stream stream)
Parameters
Type Name Description
System.IO.Stream stream

A stream to save image data to.

| Improve this Doc View Source

Save(String)

Saves the ImageFile to the specified file.

Declaration
public virtual void Save(string filename)
Parameters
Type Name Description
System.String filename

A string that contains the name of the file.

| Improve this Doc View Source

SaveAsync(Stream)

Asynchronously saves the ImageFile to the specified stream.

Declaration
public virtual Task SaveAsync(Stream stream)
Parameters
Type Name Description
System.IO.Stream stream

A stream to save image data to.

Returns
Type Description
System.Threading.Tasks.Task
| Improve this Doc View Source

SaveAsync(String)

Asynchronously saves the ImageFile to the specified file.

Declaration
public virtual Task SaveAsync(string filename)
Parameters
Type Name Description
System.String filename

A string that contains the name of the file.

Returns
Type Description
System.Threading.Tasks.Task
| Improve this Doc View Source

SaveInternal(MemoryStream)

Saves the ImageFile to the specified stream.

Declaration
protected abstract void SaveInternal(MemoryStream stream)
Parameters
Type Name Description
System.IO.MemoryStream stream

A stream to save image data to.

Back to top Copyright © 2019 Özgür Özçıtak