Class NImageMagick
Manipulation with large images using ImageMagick.
$image = NImage::fromFile('bigphoto.jpg');
$image->resize(150, 100);
$image->sharpen();
$image->send();
-
NObject
-
NImage
-
NImageMagick
Methods summary
public
|
#
__construct( string $file, string & $format = NULL )
Wraps image file.
Parameters
- $file
string detected image format
- $format
string
|
public
integer
|
#
getWidth( )
Returns image width.
Returns
integer
|
public
integer
|
#
getHeight( )
Returns image height.
Returns
integer
|
public
resource
|
#
getImageResource( )
Returns image GD resource.
Returns image GD resource.
Returns
resource
|
public
NImageMagick
|
#
resize( mixed $width, mixed $height, integer $flags = NImage::FIT )
Resizes image.
Parameters
- $width
mixed width in pixels or percent
- $height
mixed height in pixels or percent
- $flags
integer flags
Returns
|
public
NImageMagick
|
#
crop( mixed $left, mixed $top, mixed $width, mixed $height )
Crops image.
Parameters
- $left
mixed x-offset in pixels or percent
- $top
mixed y-offset in pixels or percent
- $width
mixed width in pixels or percent
- $height
mixed height in pixels or percent
Returns
|
public
boolean
|
#
save( string $file = NULL, integer $quality = NULL, integer $type = NULL )
Saves image to the file.
Parameters
- $file
string filename
- $quality
integer quality 0..100 (for JPEG and PNG)
- $type
integer optional image type
Returns
boolean TRUE on success or FALSE on failure.
|
public
|
|
Methods inherited from NImage
__call(),
__toString(),
calculateCutout(),
calculateSize(),
fromBlank(),
fromFile(),
fromString(),
place(),
rgb(),
send(),
setImageResource(),
sharpen(),
toString()
|
Properties summary
public static
string
|
$path
|
'' |
#
path to ImageMagick library
path to ImageMagick library
|
public static
string
|
$tempDir
|
|
|