PHP Класс PHPePub\Helpers\ImageHelper

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$isAnimatedGifResizeInstalled
$isExifInstalled
$isGdInstalled

Открытые методы

Метод Описание
getImage ( EPub $book, string $imageSource ) : array | boolean Get an image from a file or url, return it resized if the image exceeds the $maxImageWidth or $maxImageHeight directives.
getImageFileTypeFromBinary ( object $binary ) : string get mime type from image data
getImageScale ( $width, $height, $maxImageWidth, $maxImageHeight ) : float Scale image dimensions if they exceed the max image constraints.
handleSVGAttribs ( SimpleXMLElement $svg ) : array
isAnimatedGifResizeInstalled ( ) : boolean
isExifInstalled ( ) : mixed
isGdInstalled ( ) : mixed
scaleSVGUnit ( $length, integer $portSize = 512 ) : float Copyright WikiMedia: https://doc.wikimedia.org/mediawiki-core/master/php/SVGMetadataExtractor_8php_source.html
splitCSV ( $attr, string $sep = ',' ) : array

Описание методов

getImage() публичный статический Метод

The return value is an array. ['width'] is the width of the image. ['height'] is the height of the image. ['mime'] is the mime type of the image. Resized images are always in jpeg format. ['image'] is the image data. ['ext'] is the extension of the image file.
public static getImage ( EPub $book, string $imageSource ) : array | boolean
$book PHPePub\Core\EPub
$imageSource string path or url to file.
Результат array | boolean

getImageFileTypeFromBinary() публичный статический Метод

By fireweasel found on http://stackoverflow.com/questions/2207095/get-image-mimetype-from-resource-in-php-gd
public static getImageFileTypeFromBinary ( object $binary ) : string
$binary object
Результат string

getImageScale() публичный статический Метод

Scale image dimensions if they exceed the max image constraints.
public static getImageScale ( $width, $height, $maxImageWidth, $maxImageHeight ) : float
$width
$height
$maxImageWidth
$maxImageHeight
Результат float

handleSVGAttribs() публичный статический Метод

public static handleSVGAttribs ( SimpleXMLElement $svg ) : array
$svg SimpleXMLElement
Результат array

isAnimatedGifResizeInstalled() публичный статический Метод

public static isAnimatedGifResizeInstalled ( ) : boolean
Результат boolean

isExifInstalled() публичный статический Метод

public static isExifInstalled ( ) : mixed
Результат mixed

isGdInstalled() публичный статический Метод

public static isGdInstalled ( ) : mixed
Результат mixed

scaleSVGUnit() публичный статический Метод

Copyright WikiMedia: https://doc.wikimedia.org/mediawiki-core/master/php/SVGMetadataExtractor_8php_source.html
public static scaleSVGUnit ( $length, integer $portSize = 512 ) : float
$length
$portSize integer
Результат float

splitCSV() публичный статический Метод

public static splitCSV ( $attr, string $sep = ',' ) : array
$attr
$sep string
Результат array

Описание свойств

$isAnimatedGifResizeInstalled защищенное статическое свойство

protected static $isAnimatedGifResizeInstalled

$isExifInstalled защищенное статическое свойство

protected static $isExifInstalled

$isGdInstalled защищенное статическое свойство

protected static $isGdInstalled