--- /dev/null
+<?php
+/**
+ * Image effect easily creating small, center-cropped thumbnails.
+ *
+ * See the enclosed file COPYING for license information (LGPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
+ *
+ * @author Michael J. Rubinsky <mrubinsk@horde.org>
+ * @package Horde_Image
+ */
+class Horde_Image_Effect_Im_CenterCrop extends Horde_Image_Effect
+{
+ /**
+ * Valid parameters:
+ * <pre>
+ * width - Target width
+ * height - Target height
+ * </pre>
+ *
+ * @var array
+ */
+ protected $_params = array();
+
+ public function apply()
+ {
+ $this->_params = new Horde_Support_Array($this->_params);
+ $this->_image->addPostSrcOperation("-thumbnail {$this->_params->width}x{$this->_params->height}^ -gravity center -extent {$this->_params->width}x{$this->_params->height}");
+ $this->_image->clearGeometry();
+
+ return;
+ }
+
+}
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * Image effect easily creating small, center-cropped thumbnails.
+ *
+ * Copyright 2010 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (LGPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
+ *
+ * @author Michael J. Rubinsky <mrubinsk@horde.org>
+ * @package Horde_Image
+ */
+class Horde_Image_Effect_Imagick_CenterCrop extends Horde_Image_Effect
+{
+ /**
+ * Valid parameters:
+ * <pre>
+ * width - Target width
+ * height - Target height
+ * </pre>
+ *
+ * @var array
+ */
+ protected $_params = array();
+
+ public function apply()
+ {
+ $this->_params = new Horde_Support_Array($this->_params);
+ $this->_image->imagick->cropThumbnailImage($this->_params->width, $this->_params->height);
+ $this->_image->clearGeometry();
+
+ return;
+ }
+
+}
\ No newline at end of file
<file name="TextWatermark.php" role="php" />
<file name="Unsharpmask.php" role="php" />
<file name="LiquidResize.php" role="php" />
+ <file name="CenterCrop.php" role="php" />
</dir> <!-- /lib/Horde/Image/Effect/Im -->
<dir name="Imagick">
<file name="Border.php" role="php" />
<file name="Unsharpmask.php" role="php" />
<file name="LiquidResize.php" role="php" />
<file name="SmartCrop.php" role="php" />
+ <file name="CenterCrop.php" role="php" />
</dir> <!-- /lib/Horde/Image/Effect/Imagick -->
<file name="Border.php" role="php" />
</dir> <!-- /lib/Horde/Image/Effect -->
<install as="Horde/Image/Effect/Im/TextWatermark.php" name="lib/Horde/Image/Effect/Im/TextWatermark.php" />
<install as="Horde/Image/Effect/Im/Unsharpmask.php" name="lib/Horde/Image/Effect/Im/Unsharpmask.php" />
<install as="Horde/Image/Effect/Im/LiquidResize.php" name="lib/Horde/Image/Effect/Im/LiquidResize.php" />
+ <install as="Horde/Image/Effect/Im/CenterCrop.php" name="lib/Horde/Image/Effect/Im/CenterCrop.php" />
<install as="Horde/Image/Effect/Imagick/Border.php" name="lib/Horde/Image/Effect/Imagick/Border.php" />
<install as="Horde/Image/Effect/Imagick/Composite.php" name="lib/Horde/Image/Effect/Imagick/Composite.php" />
<install as="Horde/Image/Effect/Imagick/DropShadow.php" name="lib/Horde/Image/Effect/Imagick/DropShadow.php" />
<install as="Horde/Image/Effect/Imagick/Unsharpmask.php" name="lib/Horde/Image/Effect/Imagick/Unsharpmask.php" />
<install as="Horde/Image/Effect/Imagick/LiquidResize.php" name="lib/Horde/Image/Effect/Imagick/LiquidResize.php" />
<install as="Horde/Image/Effect/Imagick/SmartCrop.php" name="lib/Horde/Image/Effect/Imagick/SmartCrop.php" />
+ <install as="Horde/Image/Effect/Imagick/CenterCrop.php" name="lib/Horde/Image/Effect/Imagick/CenterCrop.php" />
<install as="Horde/Image/Exif/Base.php" name="lib/Horde/Image/Exif/Base.php" />
<install as="Horde/Image/Exif/Bundled.php" name="lib/Horde/Image/Exif/Bundled.php" />
<install as="Horde/Image/Exif/Exiftool.php" name="lib/Horde/Image/Exif/Exiftool.php" />