ImageInfo extends FileInfo implements LoggerAwareInterface uses LoggerAwareTrait

A SPL FileInfo class providing information related to an image.

Table of Contents

Interfaces

LoggerAwareInterface

Properties

$imageSizes  : array<string|int, mixed>|false|null

Methods

getHeight()  : int
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
Returns the width of the Image.
extractSvgImageSizes()  : false|array<string|int, mixed>
Try to read SVG as XML file and find width and height
getExifAwareImageSize()  : array<string|int, mixed>|false
Gets the image size, considering the exif-rotation present in the file
getImageSizes()  : array<string|int, mixed>
getImageSizesFromImageMagick()  : array<string|int, mixed>|null

Properties

$imageSizes

protected array<string|int, mixed>|false|null $imageSizes

Methods

getHeight()

Returns the height of the Image.

public getHeight() : int
Return values
int

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
Return values
int

extractSvgImageSizes()

Try to read SVG as XML file and find width and height

protected extractSvgImageSizes() : false|array<string|int, mixed>
Return values
false|array<string|int, mixed>

getExifAwareImageSize()

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

protected getExifAwareImageSize(string $imageFile) : array<string|int, mixed>|false
Parameters
$imageFile : string

The image filepath

Return values
array<string|int, mixed>|false

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

getImageSizes()

protected getImageSizes() : array<string|int, mixed>
Return values
array<string|int, mixed>

getImageSizesFromImageMagick()

protected getImageSizesFromImageMagick() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|null

        
On this page

Search results