<?php
namespace wcf\system\image\adapter;
+use wcf\system\event\EventHandler;
use wcf\system\exception\SystemException;
/**
else {
$this->clip($originX, $originY, $originWidth, $originHeight);
- $this->imagick->resizeImage($targetWidth, $targetHeight, \Imagick::FILTER_POINT, 0);
+ $this->imagick->resizeImage($targetWidth, $targetHeight, $this->getResizeFilter(), 0);
}
}
// does nothing
}
+ /**
+ * Returns the preferred image filter used during image resizing.
+ *
+ * @return int
+ */
+ protected function getResizeFilter() {
+ static $filter;
+
+ if ($filter === null) {
+ $parameters = ['filter' => null];
+ EventHandler::getInstance()->fireAction($this, 'getResizeFilter', $parameters);
+
+ $filter = $parameters['filter'] ?? \Imagick::FILTER_POINT;
+ }
+
+ return $filter;
+ }
+
/**
* @inheritDoc
*/