Table of Contents

Interface IImageProcessingService

Namespace
CMS.Base
Assembly
CMS.Base.dll

Interface for image processing service

public interface IImageProcessingService
Extension Methods

Methods

TryGetImageDimensions(byte[], out (int imageWidth, int imageHeight))

Gets dimensions of an image.

bool TryGetImageDimensions(byte[] image, out (int imageWidth, int imageHeight) dimensions)

Parameters

image byte[]

The image in binary data form.

dimensions (int width, int height)

A tuple containing the width and height of the image.

Returns

bool

true if the image dimensions were retrieved. Otherwise false.

TryResize(byte[], int, int, out byte[])

Resizes the specified image.

bool TryResize(byte[] image, int width, int height, out byte[] resizedImage)

Parameters

image byte[]

The image to resize in binary data form.

width int

The width to resize the image to.

height int

The height to resize the image to.

resizedImage byte[]

Binary data of resized image if resize is successful. Otherwise null.

Returns

bool

true if the image was resized. Otherwise false.