Manipulate images using standard methods such as resize, crop, rotate, etc. This class must be re-initialized for every image you wish to manipulate.
This is the code documentation for the SproutCMS project
Search documentation |
class ImageManipulate images using standard methods such as resize, crop, rotate, etc. This class must be re-initialized for every image you wish to manipulate.
Extending this class<?php
/**
* New class description goes here
*
* @author Your Name, 2026-09-16
**/
class NewClassName extends Image {
/**
* Adds text to the base of an image, e.g. for copyright credit
**/
public function addText (string $text) {
// Method code goes here
}
/**
* Calculates dimensions to be generated by a resize
**/
public function calcResizeDims (int $width, int $height, int $master) {
// Method code goes here
}
/**
* Generate a base64-encoded PNG image, e.g. for an <img src="data:image/png;base64,..."> tag
**/
public function base64 (Path $file_path, ImageTransform $transform) {
// Method code goes here
}
/**
* Creates a new Image instance and returns it.
**/
public function factory (string $image, array $config) {
// Method code goes here
}
/**
* Creates a new image editor instance.
**/
public function __construct (string $image, array $config) {
// Method code goes here
}
/**
* Handles retrieval of pre-save image properties
**/
public function __get (string $property) {
// Method code goes here
}
/**
* Resize an image to a specific width and height. By default, Kohana will
* maintain the aspect ratio using the width as the master dimension. If you
* wish to use height as master dim, set $image->master_dim = Image::HEIGHT
* This method is chainable.
**/
public function resize (integer $width, integer $height, integer $master) {
// Method code goes here
}
/**
* Save the image to a new image or overwrite this image.
**/
public function save (string $new_image, integer $chmod, boolean $keep_actions) {
// Method code goes here
}
/**
* Output the image to the browser.
**/
public function render (boolean $keep_actions) {
// Method code goes here
}
/**
* Sanitize a given value type.
**/
protected function validSize (string $type, mixed $value) {
// Method code goes here
}
/**
* Allows rotation of an image by 180 degrees clockwise or counter clockwise.
**/
public function rotate (integer $degrees) {
// Method code goes here
}
/**
* Flip an image horizontally or vertically.
**/
public function flip (integer $direction) {
// Method code goes here
}
/**
* Change the quality of an image.
**/
public function quality (integer $amount) {
// Method code goes here
}
/**
* Sharpen an image.
**/
public function sharpen (integer $amount) {
// Method code goes here
}
/**
* Crop an image to a specific width and height. You may also set the top
* and left offset.
* This method is chainable.
**/
public function crop (integer $width, integer $height, integer $top, integer $left) {
// Method code goes here
}
}
?>
|
| Powered by Pelzini, version 0.9.0 |
Documentation is made available under the
GNU Free Documentation License 1.2. Generated: Tuesday, 15th September, 2026 at 10:26 am |
|