PHP Class Devise\Media\Images\Images

Afficher le fichier Open project: devisephp/cms Class Usage Examples

Méthodes publiques

Méthode 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 méthode

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

copyImage() public méthode

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
Résultat string

cropAndResizeImage() public méthode

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
Résultat Imagick

cropImage() public méthode

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
Résultat Imagick

makeThumbnailImage() public méthode

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

resizeImage() public méthode

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
Résultat Imagick

saveImage() public méthode

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
Résultat mixed