PHP Класс Devise\Media\Images\Images

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Описание методов

canMakeThumbnailFromFile() публичный Метод

Lets us know if we can make a thumbnail from this file objet
public canMakeThumbnailFromFile ( File $file ) : boolean
$file File
Результат boolean

copyImage() публичный Метод

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
Результат string

cropAndResizeImage() публичный Метод

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
Результат Imagick

cropImage() публичный Метод

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
Результат Imagick

makeThumbnailImage() публичный Метод

Makes a thumbnail out of a file
public makeThumbnailImage ( $originalPath, string $newPath, string $mime = 'image' ) : Imagick
$originalPath
$newPath string
$mime string
Результат Imagick

resizeImage() публичный Метод

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
Результат Imagick

saveImage() публичный Метод

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
Результат mixed