/**
* @inheritDoc
*/
- public function createThumbnail($maxWidth, $maxHeight, $obtainDimensions = true) {
+ public function createThumbnail($maxWidth, $maxHeight, $preserveAspectRatio = true) {
$x = $y = 0;
$sourceWidth = $this->width;
$sourceHeight = $this->height;
- if ($obtainDimensions) {
+ if ($preserveAspectRatio) {
if ($maxWidth / $this->width < $maxHeight / $this->height) {
$width = $maxWidth;
$height = round($this->height * ($width / $this->width));
*
* @param integer $maxWidth
* @param integer $maxHeight
- * @param boolean $obtainDimensions
+ * @param boolean $preserveAspectRatio
* @return mixed
*/
- public function createThumbnail($maxWidth, $maxHeight, $obtainDimensions = true);
+ public function createThumbnail($maxWidth, $maxHeight, $preserveAspectRatio = true);
/**
* Clips a part of currently loaded image, overwrites image resource within instance.
/**
* @inheritDoc
*/
- public function createThumbnail($maxWidth, $maxHeight, $obtainDimensions = true) {
+ public function createThumbnail($maxWidth, $maxHeight, $preserveAspectRatio = true) {
if ($maxWidth > $this->getWidth() && $maxHeight > $this->getHeight()) {
throw new SystemException("Dimensions for thumbnail can not exceed image dimensions.");
}
$maxHeight = min($maxHeight, $this->getHeight());
$maxWidth = min($maxWidth, $this->getWidth());
- return $this->adapter->createThumbnail($maxWidth, $maxHeight, $obtainDimensions);
+ return $this->adapter->createThumbnail($maxWidth, $maxHeight, $preserveAspectRatio);
}
/**
/**
* @inheritDoc
*/
- public function createThumbnail($maxWidth, $maxHeight, $obtainDimensions = true) {
+ public function createThumbnail($maxWidth, $maxHeight, $preserveAspectRatio = true) {
$thumbnail = clone $this->imagick;
if ($thumbnail->getImageFormat() == 'GIF') {
$thumbnail = $thumbnail->coalesceImages();
do {
- if ($obtainDimensions) {
+ if ($preserveAspectRatio) {
$thumbnail->thumbnailImage($maxWidth, $maxHeight, true);
$thumbnail->setImagePage(0, 0, 0, 0);
}
}
while ($thumbnail->nextImage());
}
- else if ($obtainDimensions) {
+ else if ($preserveAspectRatio) {
$thumbnail->thumbnailImage($maxWidth, $maxHeight, true);
}
else {