Documentation

ExtractedImage
in package

An extracted sub-image.

Table of Contents

Properties

$filename  : string
Name of the file.
$image  : Imagick
Imagick wrapper for the image.
$saveFormat  : string
String representation of the save format.

Methods

__construct()  : mixed
Initializes a new instance of the ExtractedImage class.
asInputSource()  : BytesInput
Returns the image in a format suitable for sending to a client for parsing.
writeToFile()  : void
Writes the image to a file.
getEncodedImageFormat()  : string
Get the encoded image format.

Properties

$saveFormat

String representation of the save format.

protected string $saveFormat

Methods

__construct()

Initializes a new instance of the ExtractedImage class.

public __construct(mixed $image, string $filename, string $saveFormat) : mixed
Parameters
$image : mixed

The extracted image. Not explicitly typed as \Imagick to avoid errors.

$filename : string

The filename for the image.

$saveFormat : string

The format to save the image.

Tags
throws
MindeeUnhandledException

Throws if PDF operations aren't supported.

asInputSource()

Returns the image in a format suitable for sending to a client for parsing.

public asInputSource() : BytesInput
Tags
throws
ImagickException

Throws if the image can't be processed.

Return values
BytesInput

Bytes input for the image.

writeToFile()

Writes the image to a file.

public writeToFile(string $outputPath) : void

Uses the default image format and filename.

Parameters
$outputPath : string

The output directory (must exist).

Tags
throws
ImagickException

Throws if the image can't be processed.

getEncodedImageFormat()

Get the encoded image format.

private getEncodedImageFormat(string $saveFormat) : string
Parameters
$saveFormat : string

Format to save the file as.

Return values
string

        
On this page

Search results