PHP Class Devise\Media\Images\Images

Exibir arquivo Open project: devisephp/cms Class Usage Examples

Public Methods

Method Description
canMakeThumbnailFromFile ( File $file ) : boolean Lets us know if we can make a thumbnail from this file objet
copyImage ( string $fromImagePath, string $toImagePath ) : string Copies an image from one location to another location, also handles creating sub directories if they don't already exist for us
cropAndResizeImage ( string $imagePath, integer $width, integer $height, integer $cropWidth, integer $cropHeight, integer $cropX, integer $cropY ) : Imagick Crops the image path and then resizes, used by the JCrop tool when we upload images via the Devise Sidebar
cropImage ( string | Imagic\Imagick $imagePath, integer $cropWidth, integer $cropHeight, integer $cropX, integer $cropY ) : Imagick Crop this image path to crop dimensions, these dimensions are coming from the JCrop javascript tool being passed in to us
makeThumbnailImage ( $originalPath, string $newPath, string $mime = 'image' ) : Imagick Makes a thumbnail out of a file
resizeImage ( string | Imagic\Imagick $imagePath, integer $width, integer $height ) : Imagick Resize this image path to specified width and height
saveImage ( Imagick $image, $path ) : mixed Save the image to this path, also recursively creates the directories if they don't exist

Method Details

canMakeThumbnailFromFile() public method

Lets us know if we can make a thumbnail from this file objet
public canMakeThumbnailFromFile ( File $file ) : boolean
$file File
return boolean

copyImage() public method

Copies an image from one location to another location, also handles creating sub directories if they don't already exist for us
public copyImage ( string $fromImagePath, string $toImagePath ) : string
$fromImagePath string
$toImagePath string
return string

cropAndResizeImage() public method

Crops the image path and then resizes, used by the JCrop tool when we upload images via the Devise Sidebar
public cropAndResizeImage ( string $imagePath, integer $width, integer $height, integer $cropWidth, integer $cropHeight, integer $cropX, integer $cropY ) : Imagick
$imagePath string
$width integer
$height integer
$cropWidth integer
$cropHeight integer
$cropX integer
$cropY integer
return Imagick

cropImage() public method

Crop this image path to crop dimensions, these dimensions are coming from the JCrop javascript tool being passed in to us
public cropImage ( string | Imagic\Imagick $imagePath, integer $cropWidth, integer $cropHeight, integer $cropX, integer $cropY ) : Imagick
$imagePath string | Imagic\Imagick
$cropWidth integer
$cropHeight integer
$cropX integer
$cropY integer
return Imagick

makeThumbnailImage() public method

Makes a thumbnail out of a file
public makeThumbnailImage ( $originalPath, string $newPath, string $mime = 'image' ) : Imagick
$originalPath
$newPath string
$mime string
return Imagick

resizeImage() public method

Resize this image path to specified width and height
public resizeImage ( string | Imagic\Imagick $imagePath, integer $width, integer $height ) : Imagick
$imagePath string | Imagic\Imagick
$width integer
$height integer
return Imagick

saveImage() public method

Save the image to this path, also recursively creates the directories if they don't exist
public saveImage ( Imagick $image, $path ) : mixed
$image Imagick
$path
return mixed