This plugin is a Intervention Image library wrapper for CakePHP 3.
Since v3, CakePHP uses composer, the easiest way to set up the Bootstrap helpers is by either running
composer require lowg33kdev/cakephp-intervention-image:dev-master
or adding the following to your composer.json
and run composer update
:
"require": {
"lowg33kdev/cakephp-intervention-image": "dev-master"
}
Do not forget to load the plugin by adding the following line into your /config/bootstrap_cli.php
file:
Plugin::load('CakeInterventionImage');
If you do not use composer, simply clone the repository into your plugins/CakeInterventionImage
folder by running:
git clone https://github.com/LowG33kDev/cakephp-intervention-image.git plugins/CakeInterventionImageAnd then load the plugin with autoload set to true in your
/config/bootstrap.php
file:
Plugin::load('CakeInterventionImage' ['autoload' => true]);
Apply a gaussian blur filter with a optional amount on the current image. Use values between 0 and 100.
Note: Performance intensive on larger amounts of blur with GD driver. Use with care.
Changes the brightness of the current image by the given level. Use values between -100 for min. brightness 0 for no change and +100 for max. brightness.
Change the RGB color values of the current image on the given channels red, green and blue. The input values are normalized so you have to include parameters from 100 for maximum color value 0 for no change and -100 to take out all the certain color on the image
Changes the contrast of the current image by the given level. Use values between -100 for min. contrast 0 for no change and +100 for max. contrast.
Changes the contrast of the current image by the given level. Use values between -100 for min. contrast 0 for no change and +100 for max. contrast.
Combine cropping and resizing to format image in a smart way. The method will find the best fitting aspect ratio of your given width and height on the current image automatically, cut it out and resize it to the given dimension. You may pass an optional Closure callback as third parameter, to prevent possible upsizing and a custom position of the cutout as fourth parameter.
Mirror the current image horizontally or vertically by specifying the mode.
Performs a gamma correction operation on the current image.
Turns image into a greyscale version.
Paste a given image source over the current image with an optional position and a offset coordinate. This method can be used to apply another image as watermark because the transparency values are maintained.
Determine whether an image should be encoded in interlaced or standard mode by toggling interlace mode with a boolean parameter. If an JPEG image is set interlaced the image will be processed as a progressive JPEG.
Reverses all colors of the current image.
Apply a given image source as alpha mask to the current image to change current opacity. Mask will be resized to the current image size. By default a greyscale version of the mask is converted to alpha values, but you can set mask_with_alpha to apply the actual alpha channel. Any transparency values of the current image will be maintained.
Set the opacity in percent of the current image ranging from 100% for opaque and 0% for full transparency.
Note: Performance intensive on larger images. Use with care.
Applies a pixelation effect to the current image with a given size of pixels.
Resize the boundaries of the current image to given width and/or height. An anchor can be defined to determine from what point of the image the resizing is going to happen. Set the mode to relative to add or subtract the given width or height to the actual image dimensions. You can also pass a background color for the emerging area of the image.
Resizes current image based on given width and/or height. To constraint the resize command, pass an optional Closure callback as third parameter.
Rotate the current image counter-clockwise by a given angle. Optionally define a background color for the uncovered zone after the rotation.
Sharpen current image with an optional amount. Use values between 0 and 100.