Sections

Abstract Class Phalcon\Image\Adapter\AbstractAdapter

Broncode op GitHub

Namespace Phalcon\Image\Adapter   Uses Phalcon\Image\Enum, Phalcon\Image\Exception   Implements AdapterInterface

Phalcon\Image\Adapter

All image adapters must use this class

Properties

//
protected static checked = false;

//
protected file;

/**
 * Image height
 *
 * @var int
 */
protected height;

//
protected image;

/**
 * Image mime type
 *
 * @var string
 */
protected mime;

//
protected realpath;

/**
 * Image type
 *
 * Driver dependent
 *
 * @var int
 */
protected type;

/**
 * Image width
 *
 * @var int
 */
protected width;

Methoden

public function background( string $color, int $opacity = int ): Adapter;

Set the background color of an image

public function blur( int $radius ): Adapter;

Blur image

public function crop( int $width, int $height, int $offsetX = null, int $offsetY = null ): Adapter;

Crop an image to the given size

public function flip( int $direction ): Adapter;

Flip the image along the horizontal or vertical axis

public function getHeight(): int
public function getImage()
public function getMime(): string
public function getRealpath()
public function getType(): int
public function getWidth(): int
public function liquidRescale( int $width, int $height, int $deltaX = int, int $rigidity = int ): Adapter;

This method scales the images using liquid rescaling method. Only support Imagick

@param int $width new width @param int $height new height @param int $deltaX How much the seam can traverse on x-axis. Passing 0 causes the seams to be straight. @param int $rigidity Introduces a bias for non-straight seams. This parameter is typically 0.

public function mask( AdapterInterface $watermark ): Adapter;

Composite one image onto another

public function pixelate( int $amount ): Adapter;

Pixelate image

public function reflection( int $height, int $opacity = int, bool $fadeIn = bool ): Adapter;

Add a reflection to an image

public function render( string $ext = null, int $quality = int ): string;

Render the image and return the binary string

public function resize( int $width = null, int $height = null, int $master = static-constant-access ): Adapter;

Resize the image to the given size

public function rotate( int $degrees ): Adapter;

Rotate the image by a given amount

public function save( string $file = null, int $quality = int ): Adapter;

Save the image

public function sharpen( int $amount ): Adapter;

Sharpen the image by a given amount

public function text( string $text, mixed $offsetX = bool, mixed $offsetY = bool, int $opacity = int, string $color = string, int $size = int, string $fontfile = null ): Adapter;

Add a text to an image with a specified opacity

public function watermark( AdapterInterface $watermark, int $offsetX = int, int $offsetY = int, int $opacity = int ): Adapter;

Add a watermark to an image with the specified opacity

Interface Phalcon\Image\Adapter\AdapterInterface

Broncode op GitHub

Namespace Phalcon\Image\Adapter

This file is part of the Phalcon Framework.

(c) Phalcon Team [email protected]

For the full copyright and license information, please view the LICENSE.txt file that was distributed with this source code.

Methoden

public function background( string $color, int $opacity = int );

//

public function blur( int $radius );

//

public function crop( int $width, int $height, int $offsetX = null, int $offsetY = null );

//

public function flip( int $direction );

//

public function mask( AdapterInterface $watermark );

//

public function pixelate( int $amount );

//

public function reflection( int $height, int $opacity = int, bool $fadeIn = bool );

//

public function render( string $ext = null, int $quality = int );

//

public function resize( int $width = null, int $height = null, int $master = static-constant-access );

//

public function rotate( int $degrees );

//

public function save( string $file = null, int $quality = int );

//

public function sharpen( int $amount );

//

public function text( string $text, int $offsetX = int, int $offsetY = int, int $opacity = int, string $color = string, int $size = int, string $fontfile = null );

//

public function watermark( AdapterInterface $watermark, int $offsetX = int, int $offsetY = int, int $opacity = int );

//

Class Phalcon\Image\Adapter\Gd

Broncode op GitHub

Namespace Phalcon\Image\Adapter   Uses Phalcon\Image\Enum, Phalcon\Image\Adapter\AbstractAdapter, Phalcon\Image\Exception   Extends AbstractAdapter

This file is part of the Phalcon Framework.

(c) Phalcon Team [email protected]

For the full copyright and license information, please view the LICENSE.txt file that was distributed with this source code.

Properties

//
protected static checked = false;

Methoden

public function __construct( string $file, int $width = null, int $height = null );

//

public function __destruct();

//

protected function processBackground( int $r, int $g, int $b, int $opacity );

//

protected function processBlur( int $radius );

//

protected function processCreate( int $width, int $height );

//

protected function processCrop( int $width, int $height, int $offsetX, int $offsetY );

//

protected function processFlip( int $direction );

//

protected function processMask( AdapterInterface $mask );

//

protected function processPixelate( int $amount );

//

protected function processReflection( int $height, int $opacity, bool $fadeIn );

//

protected function processRender( string $ext, int $quality );

//

protected function processResize( int $width, int $height );

//

protected function processRotate( int $degrees );

//

protected function processSave( string $file, int $quality );

//

protected function processSharpen( int $amount );

//

protected function processText( string $text, int $offsetX, int $offsetY, int $opacity, int $r, int $g, int $b, int $size, string $fontfile );

//

protected function processWatermark( AdapterInterface $watermark, int $offsetX, int $offsetY, int $opacity );

//

Class Phalcon\Image\Adapter\Imagick

Broncode op GitHub

Namespace Phalcon\Image\Adapter   Uses Imagick, ImagickDraw, ImagickPixel, Phalcon\Image\Enum, Phalcon\Image\Adapter\AbstractAdapter, Phalcon\Image\Exception   Extends AbstractAdapter

Phalcon\Image\Adapter\Imagick

Image manipulation support. Allows images to be resized, cropped, etc.

$image = new \Phalcon\Image\Adapter\Imagick("upload/test.jpg");

$image->resize(200, 200)->rotate(90)->crop(100, 100);

if ($image->save()) {
    echo "success";
}

Properties

//
protected static checked = false;

//
protected static version = 0;

Methoden

public function __construct( string $file, int $width = null, int $height = null );

\Phalcon\Image\Adapter\Imagick constructor

public function __destruct();

Destroys the loaded image to free up resources.

public function getInternalImInstance(): \Imagick;

Get instance

public function setResourceLimit( int $type, int $limit );

Sets the limit for a particular resource in megabytes

@link http://php.net/manual/ru/imagick.constants.php#imagick.constants.resourcetypes

protected function processBackground( int $r, int $g, int $b, int $opacity );

Execute a background.

protected function processBlur( int $radius );

Blur image

@param int $radius Blur radius

protected function processCrop( int $width, int $height, int $offsetX, int $offsetY );

Execute a crop.

protected function processFlip( int $direction );

Execute a flip.

protected function processLiquidRescale( int $width, int $height, int $deltaX, int $rigidity );

This method scales the images using liquid rescaling method. Only support Imagick

@param int $width new width @param int $height new height @param int $deltaX How much the seam can traverse on x-axis. Passing 0 causes the seams to be straight. @param int $rigidity Introduces a bias for non-straight seams. This parameter is typically 0.

protected function processMask( AdapterInterface $image );

Composite one image onto another

protected function processPixelate( int $amount );

Pixelate image

@param int $amount amount to pixelate

protected function processReflection( int $height, int $opacity, bool $fadeIn );

Execute a reflection.

protected function processRender( string $extension, int $quality ): string;

Execute a render.

protected function processResize( int $width, int $height );

Execute a resize.

protected function processRotate( int $degrees );

Execute a rotation.

protected function processSave( string $file, int $quality );

Execute a save.

protected function processSharpen( int $amount );

Execute a sharpen.

protected function processText( string $text, mixed $offsetX, mixed $offsetY, int $opacity, int $r, int $g, int $b, int $size, string $fontfile );

Execute a text

protected function processWatermark( AdapterInterface $image, int $offsetX, int $offsetY, int $opacity );

Execute a watermarking.

Class Phalcon\Image\Enum

Broncode op GitHub

Namespace Phalcon\Image

This file is part of the Phalcon Framework.

(c) Phalcon Team [email protected]

For the full copyright and license information, please view the LICENSE.txt file that was distributed with this source code.

Constanten

const AUTO = 4;
const HEIGHT = 3;
const HORIZONTAL = 11;
const INVERSE = 5;
const NONE = 1;
const PRECISE = 6;
const TENSILE = 7;
const VERTICAL = 12;
const WIDTH = 2;

Class Phalcon\Image\Exception

Broncode op GitHub

Namespace Phalcon\Image   Extends \Phalcon\Exception

This file is part of the Phalcon Framework.

(c) Phalcon Team [email protected]

For the full copyright and license information, please view the LICENSE.txt file that was distributed with this source code.

Class Phalcon\Image\ImageFactory

Broncode op GitHub

Namespace Phalcon\Image   Uses Phalcon\Config, Phalcon\Factory\AbstractFactory, Phalcon\Helper\Arr, Phalcon\Image\Adapter\AdapterInterface   Extends AbstractFactory

Phalcon\Image/ImageFactory

Methoden

public function __construct( array $services = [] );

TagFactory constructor.

public function load( mixed $config ): AdapterInterface;

Factory to create an instace from a Config object

public function newInstance( string $name, string $file, int $width = null, int $height = null ): AdapterInterface;

Creates a new instance

protected function getAdapters(): array;

//