Devise
Class

Devise\Media\Images\Images

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

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

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

Resize this image path to specified width and height

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

mixed saveImage(Imagick $image, $path $path)

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

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

Makes a thumbnail out of a file

Details

at line 18
public 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
public 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 71
public 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 103
public 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 122
public mixed saveImage(Imagick $image, $path $path)

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

Parameters

Imagick $image
$path $path

Return Value

mixed

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

Makes a thumbnail out of a file

Parameters

$originalPath $originalPath
string $newPath
string $mime

Return Value

Imagick