Packages

  • Nette
    • Application
    • Caching
    • Collections
    • Config
    • Forms
    • IO
    • Loaders
    • Mail
    • Reflection
    • Security
    • Templates
    • Web
  • None
  • PHP

Classes

  • NArrayTools
  • NCallback
  • NComponent
  • NComponentContainer
  • NConfigurator
  • NDateTime53
  • NDebug
  • NEnvironment
  • NFramework
  • NFreezableObject
  • NGenericRecursiveIterator
  • NImage
  • NImageMagick
  • NInstanceFilterIterator
  • NObject
  • NObjectMixin
  • NPaginator
  • NRecursiveComponentIterator
  • NServiceLocator
  • NSmartCachingIterator
  • NString
  • NTools

Interfaces

  • IComponent
  • IComponentContainer
  • IDebuggable
  • IServiceLocator
  • ITranslator

Exceptions

  • NAmbiguousServiceException
  • Overview
  • Package
  • Class
  • Tree
  • Other releases

Class NImageMagick

Manipulation with large images using ImageMagick.

$image = NImage::fromFile('bigphoto.jpg');
$image->resize(150, 100);
$image->sharpen();
$image->send();
NObject
Extended by NImage
Extended by NImageMagick
Package: Nette
Author: David Grudl
Located at Utils/ImageMagick.php
Methods summary
public
# __construct( string $file, string & $format = NULL )

Wraps image file.

Wraps image file.

Parameters

$file
string
detected image format
$format
string
public integer
# getWidth( )

Returns image width.

Returns image width.

Returns

integer
public integer
# getHeight( )

Returns image height.

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.

Resizes image.

Parameters

$width
mixed
width in pixels or percent
$height
mixed
height in pixels or percent
$flags
integer
flags

Returns

NImageMagick
provides a fluent interface
public NImageMagick
# crop( mixed $left, mixed $top, mixed $width, mixed $height )

Crops image.

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

NImageMagick
provides a fluent interface
public boolean
# save( string $file = NULL, integer $quality = NULL, integer $type = NULL )

Saves image to the file.

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
# __destruct( )

Delete temporary files.

Delete temporary files.

Methods inherited from NImage
__call(), __toString(), calculateCutout(), calculateSize(), fromBlank(), fromFile(), fromString(), place(), rgb(), send(), setImageResource(), sharpen(), toString()
Methods inherited from NObject
__callStatic(), __get(), __isset(), __set(), __unset(), extensionMethod(), getReflection()
Constants inherited from NImage
EMPTY_GIF, ENLARGE, FILL, FIT, GIF, JPEG, PNG, STRETCH
Properties summary
public static string $path ''
#

path to ImageMagick library

path to ImageMagick library

public static string $tempDir
#
Properties inherited from NImage
$useImageMagick
Nette Framework 0.9.7 (for PHP 5.2) API documentation generated by ApiGen 2.3.0