PHP 클래스 PHPePub\Helpers\ImageHelper

파일 보기 프로젝트 열기: grandt/phpepub 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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