Only resize thumbnail if it is too large
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 7 Jul 2009 17:59:52 +0000 (11:59 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 7 Jul 2009 19:47:33 +0000 (13:47 -0600)
imp/lib/Mime/Viewer/Images.php

index 9dc6b07..f330e66 100644 (file)
@@ -218,7 +218,10 @@ EOD;
 
         if ($img) {
             if ($thumb) {
-                $img->resize(96, 96, true);
+                $dim = $img->getDimensions();
+                if (($dim['height'] > 96) || ($dim['width'] > 96)) {
+                    $img->resize(96, 96, true);
+                }
             }
             $type = $img->getContentType();
             $data = $img->raw(true);