Download the PHP package yii-ext/yii-easyimage without Composer
On this page you can find all versions of the php package yii-ext/yii-easyimage. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package yii-easyimage
yii-easyimage
You don't need to create many types of thumbnails for images in your project.
You can create a thumbnail directly in the View
. Thumbnail will automatically cached. It's easy!
Features:
- Easy to use
- Support
GD
andImagick
- Automaticly thumbnails caching
- Cache sorting to subdirectories
- Support
Retina
displays - Based on Kohana Image Library.
Installing and configuring
Extract the EasyImage
folder under protected/extensions
Add the following to your config file components
section:
and the following to import
section:
Usage
InstanceOf
Parameters
- string
$file
required - Image file path - string
$driver
- Driver:GD
,Imagick
ThumbOf
You can create a thumbnail directly in the View
:
Note. This method return CHtml::image()
Parameters
- string
$file
required - Image file path - array
$params
- Image manipulation methods. See Methods - array
$htmlOptions
- options for CHtml::image()
ThumbSrcOf
Note. This method return path to image cached.
Parameters
- string
$file
required - Image file path - array
$params
- Image manipulation methods. See Methods
Methods
Resize
Parameters
- integer
$width
- New width - integer
$height
- New height - integer
$master
- Master dimension:EasyImage::RESIZE_NONE
,EasyImage::RESIZE_WIDTH
,EasyImage::RESIZE_HEIGHT
,EasyImage::RESIZE_AUTO
,EasyImage::RESIZE_INVERSE
,EasyImage::RESIZE_PRECISE
Crop
Parameters
- integer
$width
required - New width - integer
$height
required - New height - mixed
$offset_x
=NULL
- Offset from the left - mixed
$offset_y
=NULL
- Offset from the top
Rotate
Parameters
- integer
$degrees
required - Degrees to rotate: -360-360
Flip
Parameters
- integer
$direction
required - Direction:EasyImage::RESIZE_NONE
,EasyImage::RESIZE_WIDTH
.
Sharpen
Parameters
- integer
$amount
required - Amount to sharpen (percent): 1-100
Reflection
Note. By default, the reflection will be go from transparent at the top to opaque at the bottom.
Parameters
- integer
$height
=NULL
- Reflection height - integer
$opacity
=100
- Reflection opacity: 0-100 - boolean
$fade_in
=FALSE
-TRUE
to fade in,FALSE
to fade out
Watermark
Note. If no offset is specified, the center of the axis will be used. If an offset of TRUE
is specified, the bottom of the axis will be used.
Parameters
- mixed
$watermark
required - WatermarkEasyImage
instance or path to Image - integer
$offset_x
=NULL
- Offset from the left - integer
$offset_y
=NULL
- Offset from the top - integer
$opacity
=100
- Opacity of watermark: 1-100
Background
Note This is only useful for images with alpha transparency.
Parameters
- string
$color
required - Hexadecimal color value - integer
$opacity
=100
- Background opacity: 0-100
Quality
Note This is only useful for JPG
images.
Parameters
- integer required - Quality of image: 1-100
Type
Parameters
- string required - Image type to return:
png
,jpg
,gif
, etc
Save
Parameters
- string
$file
=NULL
- New image path - integer
$quality
=100
- Quality of image: 1-100
Render
Parameters
- string
$type
=NULL
- Image type to return:png
,jpg
,gif
, etc - integer
$quality
=100
- Quality of image: 1-100