]> git.mjollnir.org Git - s9y.git/commitdiff
fix imagemagick
authorgarvinhicking <garvinhicking>
Mon, 7 Nov 2005 15:28:47 +0000 (15:28 +0000)
committergarvinhicking <garvinhicking>
Mon, 7 Nov 2005 15:28:47 +0000 (15:28 +0000)
docs/NEWS
include/functions_images.inc.php

index 666691bae7d33d0b6a3dead70d85fcef8f501b54..e054dd6b9522f77b7bbcf88bbd9796a899a2549d 100644 (file)
--- a/docs/NEWS
+++ b/docs/NEWS
@@ -3,6 +3,10 @@
 Version 0.9.1 ()
 ------------------------------------------------------------------------
 
+    * Fix thumbnail generation for imageMagick when target image is
+      smaller than the target size, it should not be blown up
+      (garvinhicking)
+
     * Fix spartacus plugin to not properly indicate updatable versions
       of plugins (garvinhicking)
           
index d18fd1220d9693c7a87409962d5786cb47eb3b3a..ab4da54f17c215e844f7be065d977359224abf9a 100644 (file)
@@ -330,7 +330,8 @@ function serendipity_makeThumbnail($file, $directory = '', $size = false) {
             if ($fdim['mime'] == 'application/pdf') {
                $cmd     = escapeshellcmd($serendipity['convert']) . ' -antialias -flatten -scale '. serendipity_escapeshellarg($newSize) .' '. serendipity_escapeshellarg($infile) .' '. serendipity_escapeshellarg($outfile . '.png');
             } else {
-               $cmd     = escapeshellcmd($serendipity['convert']) . ' -antialias -scale '. serendipity_escapeshellarg($newSize) .' '. serendipity_escapeshellarg($infile) .' '. serendipity_escapeshellarg($outfile);
+               $newSize .= '>'; // Tell imagemagick to not enlarge small images
+               $cmd     = escapeshellcmd($serendipity['convert']) . ' -antialias -resize '. serendipity_escapeshellarg($newSize) .' '. serendipity_escapeshellarg($infile) .' '. serendipity_escapeshellarg($outfile);
             }
             exec($cmd, $output, $result);
             if ( $result != 0 ) {