Omeka_File_Derivative_Strategy_Imagick

Package: File\Derivative\Strategy

class Omeka_File_Derivative_Strategy_Imagick

extends Omeka_File_Derivative_AbstractStrategy

Strategy for making derivatives with the Imagick PHP extension.

The strategy requires ext/imagick.

Omeka_File_Derivative_Strategy_Imagick::__construct()

Check for the imagick extension at creation.

Omeka_File_Derivative_Strategy_Imagick::createImage($sourcePath, $destPath, $type, $sizeConstraint, $mimeType)

Generate a derivative image with Imagick.

Parameters:
  • $sourcePath
  • $destPath
  • $type
  • $sizeConstraint
  • $mimeType
Omeka_File_Derivative_Strategy_Imagick::_getCropOffsetX($resizedX, $sizeConstraint)

Get the required crop offset on the X axis.

This respects the ‘gravity’ setting.

Parameters:
  • $resizedX (int) – Pre-crop image width
  • $sizeConstraint (int) –
Returns:

int

Omeka_File_Derivative_Strategy_Imagick::_getCropOffsetY($resizedY, $sizeConstraint)

Get the required crop offset on the Y axis.

This respects the ‘gravity’ setting.

Parameters:
  • $resizedY (int) – Pre-crop image height
  • $sizeConstraint (int) –
Returns:

int

Omeka_File_Derivative_Strategy_Imagick::_autoOrient($imagick)
Parameters:
  • $imagick