ImageInfo extends FileInfo implements LoggerAwareInterface uses LoggerAwareTrait

An SPL FileInfo class providing information related to an image.

Table of Contents

Interfaces

LoggerAwareInterface

Properties

$imageSizes  : array{0: int<0, max>|string, 1: int<0, max>|string, 2?: string, 3?: string, 4?: string}|false|null

Methods

getHeight()  : int<0, max>
Returns the height of the image.
getMimeExtensions()  : array<string|int, string>
Returns the file extensions appropriate for a the MIME type detected in the file. For types that commonly have multiple file extensions, such as JPEG images, then the return value is multiple extensions, for instance that could be ['jpeg', 'jpg', 'jpe', 'jiff']. For unknown types not available in the magic.mime database (/etc/magic.mime, /etc/mime.types, ...), then return value is an empty array.
getMimeType()  : string|false
Return the mime type of a file.
getWidth()  : int<0, max>
Returns the width of the image.
extractSvgImageSizes()  : array{0: int<0, max>, 1: int<0, max>}|false
Tries to read SVG as XML file and find width and height.
getExifAwareImageSize()  : array{0: int<0, max>, 1: int<0, max>}|false
Gets the image size, considering the exif-rotation present in the file
getImageSizes()  : array{0: int<0, max>|string, 1: int<0, max>|string, 2?: string, 3?: string, 4?: string}
getImageSizesFromImageMagick()  : array{0: string, 1: string, 2: string, 3: string, 4: string}|null

Properties

$imageSizes

protected array{0: int<0, max>|string, 1: int<0, max>|string, 2?: string, 3?: string, 4?: string}|false|null $imageSizes

Methods

getHeight()

Returns the height of the image.

public getHeight() : int<0, max>
Return values
int<0, max>

getMimeExtensions()

Returns the file extensions appropriate for a the MIME type detected in the file. For types that commonly have multiple file extensions, such as JPEG images, then the return value is multiple extensions, for instance that could be ['jpeg', 'jpg', 'jpe', 'jiff']. For unknown types not available in the magic.mime database (/etc/magic.mime, /etc/mime.types, ...), then return value is an empty array.

public getMimeExtensions() : array<string|int, string>

TYPO3 specific settings in $GLOBALS['TYPO3_CONF_VARS']['SYS']['FileInfo']['fileExtensionToMimeType'] take precedence over native resolving.

Return values
array<string|int, string>

getMimeType()

Return the mime type of a file.

public getMimeType() : string|false

TYPO3 specific settings in $GLOBALS['TYPO3_CONF_VARS']['SYS']['FileInfo']['fileExtensionToMimeType'] take precedence over native resolving.

Return values
string|false

Returns the mime type or FALSE if the mime type could not be discovered

getWidth()

Returns the width of the image.

public getWidth() : int<0, max>
Return values
int<0, max>

extractSvgImageSizes()

Tries to read SVG as XML file and find width and height.

protected extractSvgImageSizes() : array{0: int<0, max>, 1: int<0, max>}|false
Return values
array{0: int<0, max>, 1: int<0, max>}|false

getExifAwareImageSize()

Gets the image size, considering the exif-rotation present in the file

protected getExifAwareImageSize(string $imageFile) : array{0: int<0, max>, 1: int<0, max>}|false
Parameters
$imageFile : string

The image filepath

Return values
array{0: int<0, max>, 1: int<0, max>}|false

an array where [0]/[1] is w/h

getImageSizes()

protected getImageSizes() : array{0: int<0, max>|string, 1: int<0, max>|string, 2?: string, 3?: string, 4?: string}
Return values
array{0: int<0, max>|string, 1: int<0, max>|string, 2?: string, 3?: string, 4?: string}

getImageSizesFromImageMagick()

protected getImageSizesFromImageMagick() : array{0: string, 1: string, 2: string, 3: string, 4: string}|null
Return values
array{0: string, 1: string, 2: string, 3: string, 4: string}|null

        
On this page

Search results