class Images

Methods

string
copyImage(string $fromImagePath, string $toImagePath)

Copies an image from one location to another location, also handles creating sub directories if they don't already exist for us

cropImage(string|Imagick $imagePath, integer $cropWidth, integer $cropHeight, integer $cropX, integer $cropY)

Crop this image path to crop dimensions, these dimensions are coming from the JCrop javascript tool being passed in to us

boolean
canMakeThumbnailFromFile(File $file)

Lets us know if we can make a thumbnail from this file objet

resizeImage(string|Imagick $imagePath, integer $width, integer $height)

Resize this image path to specified width and height

cropAndResizeImage(string $imagePath, integer $width, integer $height, integer $cropWidth, integer $cropHeight, integer $cropX, integer $cropY)

Crops the image path and then resizes, used by the JCrop tool when we upload images via the Devise Sidebar

mixed
saveImage(Imagick $image, $path)

Save the image to this path, also recursively creates the directories if they don't exist

makeThumbnailImage($originalPath, string $newPath, string $mime = 'image')

Makes a thumbnail out of a file

Details

at line 18
string copyImage(string $fromImagePath, string $toImagePath)

Copies an image from one location to another location, also handles creating sub directories if they don't already exist for us

Parameters

string $fromImagePath
string $toImagePath

Return Value

string

Exceptions

InvalidFileException

at line 50
Imagick cropImage(string|Imagick $imagePath, integer $cropWidth, integer $cropHeight, integer $cropX, integer $cropY)

Crop this image path to crop dimensions, these dimensions are coming from the JCrop javascript tool being passed in to us

Parameters

string|Imagick $imagePath
integer $cropWidth
integer $cropHeight
integer $cropX
integer $cropY

Return Value

Imagick

at line 69
boolean canMakeThumbnailFromFile(File $file)

Lets us know if we can make a thumbnail from this file objet

Parameters

File $file

Return Value

boolean

at line 82
Imagick resizeImage(string|Imagick $imagePath, integer $width, integer $height)

Resize this image path to specified width and height

Parameters

string|Imagick $imagePath
integer $width
integer $height

Return Value

Imagick

at line 114
Imagick cropAndResizeImage(string $imagePath, integer $width, integer $height, integer $cropWidth, integer $cropHeight, integer $cropX, integer $cropY)

Crops the image path and then resizes, used by the JCrop tool when we upload images via the Devise Sidebar

Parameters

string $imagePath
integer $width
integer $height
integer $cropWidth
integer $cropHeight
integer $cropX
integer $cropY

Return Value

Imagick

at line 133
mixed saveImage(Imagick $image, $path)

Save the image to this path, also recursively creates the directories if they don't exist

Parameters

Imagick $image
$path

Return Value

mixed

at line 156
Imagick makeThumbnailImage($originalPath, string $newPath, string $mime = 'image')

Makes a thumbnail out of a file

Parameters

$originalPath
string $newPath
string $mime

Return Value

Imagick