Table of Contents

Method Compute

Namespace
LMKit.Media.Image
Assembly
LM-Kit.NET.dll

Compute(byte[])

Computes the fingerprint of an encoded image file, as the picture is displayed: the orientation the file states (EXIF) is applied first, so a photo stored sideways with an orientation tag has the fingerprint of its upright copy.

public static ImageFingerprint Compute(byte[] data)

Parameters

data byte[]

The encoded image (JPEG, PNG, WebP, TIFF, ...). The first page of a multi-page file is read.

Returns

ImageFingerprint

The fingerprint of the displayed picture.

Exceptions

ArgumentNullException

Thrown if data is null.

ArgumentException

Thrown if data is empty.

InvalidOperationException

Thrown if the data cannot be decoded as an image.

Compute(byte[], int)

Computes the fingerprint of one page of an encoded image file, as the picture is displayed. See Compute(byte[]).

public static ImageFingerprint Compute(byte[] data, int pageIndex)

Parameters

data byte[]

The encoded image (JPEG, PNG, WebP, TIFF, ...).

pageIndex int

Zero-based page of a multi-page file (a TIFF scan). The orientation a file states describes its first page and is applied to that page only.

Returns

ImageFingerprint

The fingerprint of the page.

Exceptions

ArgumentNullException

Thrown if data is null.

ArgumentException

Thrown if data is empty.

ArgumentOutOfRangeException

Thrown if the file does not hold the page.

InvalidOperationException

Thrown if the data cannot be decoded as an image.

Compute(ImageBuffer)

Computes the fingerprint of decoded pixels, exactly as the buffer holds them. A buffer decoded from a file that states an orientation holds the stored pixels, not the displayed picture: use Compute(byte[]) on the file to honor it.

public static ImageFingerprint Compute(ImageBuffer image)

Parameters

image ImageBuffer

The image to describe. It is never modified. Transparent areas are read as white.

Returns

ImageFingerprint

The fingerprint of the image.

Exceptions

ArgumentNullException

Thrown if image is null.

ArgumentException

Thrown if the image has no pixel.

ObjectDisposedException

Thrown if the image has been disposed.

Share