ImageInfo

class \TYPO3\CMS\Core\Type\File\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|false|null

Methods

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

Properties

$imageSizes

protected array|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() : string[]

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

Return values

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

Return values

false|array

getExifAwareImageSize()

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

protected getExifAwareImageSize(string $imageFile) : array|false

Parameters

$imageFile : string

The image filepath

Return values

array|false —

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

getImageSizes()

protected getImageSizes() : array

Return values

array

getImageSizesFromImageMagick()

protected getImageSizesFromImageMagick() : array|null

Return values

array|null
On this page