Fixed ImageMagick issue
authorMarcel Werk <burntime@woltlab.com>
Sat, 23 Nov 2013 22:19:57 +0000 (23:19 +0100)
committerMarcel Werk <burntime@woltlab.com>
Sat, 23 Nov 2013 22:19:57 +0000 (23:19 +0100)
wcfsetup/install/files/lib/system/image/adapter/ImagickImageAdapter.class.php

index 699680a38a85bdcb4652cec7b1bce5d8e7709bd3..97e55de8be2ce1c3e783d303fb168072e515dd1f 100644 (file)
@@ -82,9 +82,14 @@ class ImagickImageAdapter implements IImageAdapter {
         * @see \wcf\system\image\adapter\IImageAdapter::createThumbnail()
         */
        public function createThumbnail($maxWidth, $maxHeight, $obtainDimensions = true) {
-               /* todo: obtainDimensions=false doesn't work */
                $thumbnail = clone $this->imagick;
-               $thumbnail->cropThumbnailImage($maxWidth, $maxHeight);
+               
+               if ($obtainDimensions) {
+                       $thumbnail->thumbnailImage($maxWidth, $maxHeight, true);
+               }
+               else {
+                       $thumbnail->cropThumbnailImage($maxWidth, $maxHeight);
+               }
                
                return $thumbnail;
        }