The graphics_imagemagick class provides depage::graphics features using the ImageMagick library.
use ghostscript to convert pdf and eps files directly
or use poppler pdftoppm to convert pdf directly
Definition at line 22 of file Imagemagick.php.
Public Member Functions | |
| __construct ($options=array()) | |
| graphics_graphicsmagick class constructor | |
| canRead ($ext) | |
| Checks if extension support reading file type. | |
| render ($input, $output=null) | |
| Main method for image handling. | |
| Public Member Functions inherited from Graphics | |
| canWrite ($ext) | |
| Checks if extension supports writing file type. | |
| addBackground ($background) | |
| Background "action". | |
| addCrop ($width, $height, $x=0, $y=0) | |
| Adds crop action. | |
| addResize ($width, $height) | |
| Adds resize action. | |
| addThumb ($width, $height) | |
| Adds thumb action. | |
| addThumbfill ($width, $height, $centerX=50, $centerY=50) | |
| Adds thumb-fill action. | |
| renderFinished () | |
| Called after rendering has finished. | |
| optimizeImage ($filename) | |
| Opimizes final image through one of the optimization programs. | |
| setQuality ($quality) | |
| Sets quality parameter. | |
| getPageNumber () | |
| getPageNumber | |
Protected Member Functions | |
| crop ($width, $height, $x=0, $y=0) | |
| Crop action. | |
| resize ($width, $height) | |
| Resize action. | |
| thumb ($width, $height) | |
| Thumb action. | |
| thumbfill ($width, $height, $centerX=50, $centerY=50) | |
| Thumb action. | |
| getImageSize () | |
| Determine size of input image. | |
| execCommand () | |
| Executes ImageMagick command. | |
| getBackground () | |
| Generates background command. | |
| getQuality () | |
| Generates quality command. | |
| getOptimize () | |
| Generates optimization parameters. | |
| getResizeAction ($width, $height) | |
| Gets the resize action depending on target size. | |
| Protected Member Functions inherited from Graphics | |
| escapeNumber ($number) | |
| Validates integers. | |
| dimensions ($width, $height) | |
| Scales image dimensions. | |
| processQueue () | |
| Process action queue. | |
| lock () | |
| lock | |
| unlock () | |
| unlock | |
| obtainFormat ($fileName) | |
| Determines image format from file extension. | |
| bypassTest ($width, $height, $x=0, $y=0) | |
| Tests if action would change current image. | |
| bypass () | |
| Runs bypass (copies file) | |
Protected Attributes | |
| $command = '' | |
| Imagemagick command string. | |
| $executable | |
| Imagemagick executable path. | |
| $timeout = 0 | |
| timeout after which the image conversion will be canceled | |
| Protected Attributes inherited from Graphics | |
| $input | |
| Input filename. | |
| $output | |
| Output filename. | |
| $format | |
| Output format. | |
| $outputLockFp = null | |
| $otherRender = false | |
| otherRender is set to true if another render process has already locked file | |
| $queue = array() | |
| Action queue array. | |
| $size = array() | |
| Image size array(width, height) | |
| $background | |
| Image background string. | |
| $quality = '' | |
| Image quality string. | |
| $optimize | |
| Optimize output images. | |
| $optimizers | |
| List of optimizer binaries. | |
| $limits = [] | |
| limits (mainly for imagemagick and graphicsmagick) | |
| $inputFormat | |
| Input image format. | |
| $outputFormat | |
| Output image format. | |
| $bypass = true | |
| Process bypass bool. | |
Additional Inherited Members | |
| Static Public Member Functions inherited from Graphics | |
| static | factory ($options=array()) |
| graphics object factory | |
| static | which ($binary) |
| Executes "which" command. | |
| __construct | ( | $options = array() | ) |
| array | $options | image processing parameters |
Reimplemented from Graphics.
Definition at line 41 of file Imagemagick.php.
| canRead | ( | $ext | ) |
| string | $ext | file extension |
Reimplemented from Graphics.
Definition at line 55 of file Imagemagick.php.
|
protected |
Adds crop command to command string.
| int | $width | output width |
| int | $height | output height |
| int | $x | crop x-offset |
| int | $y | crop y-offset |
Reimplemented in Graphicsmagick.
Definition at line 71 of file Imagemagick.php.
|
protected |
|
protected |
Reimplemented in Graphicsmagick.
Definition at line 295 of file Imagemagick.php.
|
protected |
|
protected |
Definition at line 335 of file Imagemagick.php.
|
protected |
Reimplemented from Graphics.
Definition at line 318 of file Imagemagick.php.
|
protected |
this assumes that all images below 160px width or height will be thumbnails everything bigger gets resized slowly in better quality
Definition at line 357 of file Imagemagick.php.
| render | ( | $input, | |
| $output = null ) |
Starts actions, saves image, calls bypass if necessary.
| string | $input | input filename |
| string | $output | output filename |
Reimplemented from Graphics.
Reimplemented in Graphicsmagick.
Definition at line 196 of file Imagemagick.php.
|
protected |
Adds resize command to command string.
| int | $width | output width |
| int | $height | output height |
Definition at line 91 of file Imagemagick.php.
|
protected |
Adds thumb command to command string.
| int | $width | output width |
| int | $height | output height |
Definition at line 112 of file Imagemagick.php.
|
protected |
Adds thumb command to command string.
| int | $width | output width |
| int | $height | output height |
| int | $centerX | center of image from left in percent |
| int | $centerY | center of image from top in percent |
Definition at line 132 of file Imagemagick.php.
|
protected |
Definition at line 27 of file Imagemagick.php.
|
protected |
Definition at line 31 of file Imagemagick.php.
|
protected |
Definition at line 35 of file Imagemagick.php.