splitbrain/slika

ImageMagickAdapter extends Adapter
in package

Image Processing Adapter for ImageMagick's command line utility `convert`

Table of Contents

Properties

$args  : array<string|int, mixed>
$imagepath  : string
$options  : array<string|int, mixed>

Methods

__construct()  : mixed
New Slika Adapter
autorotate()  : Adapter
Rote the image based on the rotation exif tag
crop()  : Adapter
Resize to the given dimension, cropping the image as needed
resize()  : Adapter
Resize to make image fit the given dimension (maintaining the aspect ratio)
rotate()  : Adapter
Rotate and/or flip the image
save()  : void
Save the new file

Properties

$args

protected array<string|int, mixed> $args = []

the CLI arguments to run imagemagick

$imagepath

protected string $imagepath

path to the image

$options

protected array<string|int, mixed> $options

Adapter Options

Methods

__construct()

New Slika Adapter

public __construct(mixed $imagepath[, mixed $options = [] ]) : mixed
Parameters
$imagepath : mixed

path to the original image

$options : mixed = []

set options

Tags
inheritDoc

crop()

Resize to the given dimension, cropping the image as needed

public crop(mixed $width, mixed $height[, mixed $upscale = true ]) : Adapter
Parameters
$width : mixed

in pixels

$height : mixed

in pixels

$upscale : mixed = true

when false, an image smaller than the target area is cropped but never enlarged

Tags
inheritDoc
throws
Exception
Return values
Adapter

resize()

Resize to make image fit the given dimension (maintaining the aspect ratio)

public resize(mixed $width, mixed $height[, mixed $upscale = true ]) : Adapter
Parameters
$width : mixed

in pixels or %

$height : mixed

in pixels or %

$upscale : mixed = true

when false, an image smaller than the target is kept at its original size

Tags
inheritDoc
throws
Exception
Return values
Adapter

rotate()

Rotate and/or flip the image

public rotate(mixed $orientation) : Adapter
Parameters
$orientation : mixed

Exif rotation flags

Tags
inheritDoc
Return values
Adapter

save()

Save the new file

public save(mixed $path[, mixed $extension = '' ]) : void
Parameters
$path : mixed
$extension : mixed = ''

The type of image to save, empty for original

Tags
inheritDoc
throws
Exception
On this page

Search results