\Fuman_File_Processor_Resize

Processor which resizes an image

Summary

Methods
Properties
Constants
createImageMeta()
updateFileMetaProperty()
process()
No public properties found
No constants found
_getImageHandle()
_createImageHandle()
_saveImage()
_findNewImageSize()
_resize()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

createImageMeta()

createImageMeta(\Fuman_File  $file) : boolean

Creates image meta data (with, height) and ands info to meta property

Parameters

\Fuman_File $file

Returns

boolean

updateFileMetaProperty()

updateFileMetaProperty(\Fuman_File  $file, integer  $width, integer  $height) 

Update file meta property

Parameters

\Fuman_File $file
integer $width
integer $height

process()

process(\Fuman_File  $file, \stdClass|null  $options = null) : boolean

Resize image

Parameters

\Fuman_File $file
\stdClass|null $options

Throws

\Fuman_Exception
\Exception

Returns

boolean

_getImageHandle()

_getImageHandle(\Fuman_File  $file) : boolean|\stdClass

Create image handle

Parameters

\Fuman_File $file

Returns

boolean|\stdClass

_createImageHandle()

_createImageHandle(integer  $width, integer  $height, array  $imageInfo) : resource

Create image handle

Parameters

integer $width
integer $height
array $imageInfo

Returns

resource

_saveImage()

_saveImage(\Fuman_File  $file, \stdClass  $imageData) : boolean

Saves image depending on mime type (jpeg, png, gif)

Parameters

\Fuman_File $file
\stdClass $imageData

Returns

boolean

_findNewImageSize()

_findNewImageSize(integer  $maxFileSize, integer  $minQuality, integer  $maxQuality, \Fuman_File  $file, \Fuman_File  $tempFile) : integer

finds the appropriate quality

Parameters

integer $maxFileSize
integer $minQuality
integer $maxQuality
\Fuman_File $file
\Fuman_File $tempFile

Returns

integer

_resize()

_resize(\Fuman_File  $file,   $image,   $width,   $height) : boolean

Resize

Parameters

\Fuman_File $file
$image
$width
$height

Returns

boolean