summaryrefslogtreecommitdiff
path: root/plugins/processor.magickwand.php
diff options
context:
space:
mode:
authorChristian Fowler <spider@viovio.com>2007-02-14 02:59:14 +0000
committerChristian Fowler <spider@viovio.com>2007-02-14 02:59:14 +0000
commit8e9e5ec7178efb247dd719438f0c157140f81048 (patch)
treee0d78efb4f3aba85faf6d0dc6db0373dfff2e2f6 /plugins/processor.magickwand.php
parentfbc6ba801f53e26ed928e4e020512b118bd282b5 (diff)
downloadliberty-8e9e5ec7178efb247dd719438f0c157140f81048.tar.gz
liberty-8e9e5ec7178efb247dd719438f0c157140f81048.tar.bz2
liberty-8e9e5ec7178efb247dd719438f0c157140f81048.zip
waterdragon's fix to prevent upsizing on thumbnailing. tested, works well
Diffstat (limited to 'plugins/processor.magickwand.php')
-rw-r--r--plugins/processor.magickwand.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/processor.magickwand.php b/plugins/processor.magickwand.php
index b0aafd0..1657a85 100644
--- a/plugins/processor.magickwand.php
+++ b/plugins/processor.magickwand.php
@@ -1,6 +1,6 @@
<?php
/**
- * $Header: /cvsroot/bitweaver/_bit_liberty/plugins/processor.magickwand.php,v 1.1 2006/12/22 11:53:17 squareing Exp $
+ * $Header: /cvsroot/bitweaver/_bit_liberty/plugins/processor.magickwand.php,v 1.2 2007/02/14 02:59:14 spiderr Exp $
*
* Image processor - extension: php-magickwand
* @package liberty
@@ -79,6 +79,12 @@ function liberty_magickwand_resize_image( &$pFileHash, $pFormat = NULL ) {
$pFileHash['max_height'] = round( ($iheight / $iwidth) * $pFileHash['max_width'] );
}
+ // Make sure not to scale up
+ if( $pFileHash['max_width'] > $iwidth && $pFileHash['max_height'] > $iheight) {
+ $pFileHash['max_width'] = $iwidth;
+ $pFileHash['max_height'] = $iheight;
+ }
+
list($type, $mimeExt) = split( '/', strtolower( $itype ) );
if( !empty( $pFileHash['max_width'] ) && !empty( $pFileHash['max_height'] ) && ( ($pFileHash['max_width'] < $iwidth || $pFileHash['max_height'] < $iheight ) || ($mimeExt != 'jpeg')) || !empty( $pFileHash['colorspace_conversion'] ) ) {
// We have to resize. *ALL* resizes are converted to jpeg