summaryrefslogtreecommitdiff
path: root/plugins/processor.magickwand.php
diff options
context:
space:
mode:
authorMax Kremmel <xing@synapse.plus.com>2007-09-25 15:36:09 +0000
committerMax Kremmel <xing@synapse.plus.com>2007-09-25 15:36:09 +0000
commitd5b644bbc19898ac5b1d68daecdc64145554893b (patch)
treee0ac74f2bcfd59e0bd0bf79405a2cb85aca77991 /plugins/processor.magickwand.php
parent5c8e2c3c54e08943751c322e63b4adc6a26f4832 (diff)
downloadliberty-d5b644bbc19898ac5b1d68daecdc64145554893b.tar.gz
liberty-d5b644bbc19898ac5b1d68daecdc64145554893b.tar.bz2
liberty-d5b644bbc19898ac5b1d68daecdc64145554893b.zip
clean up image processing admin options, add preliminary support for php-imagick > 2.0 with the new API. this pecl extension is still in beta and still seems to be missing some error methods. please keep an eye on this processor as new versions of php-imagick are released
Diffstat (limited to 'plugins/processor.magickwand.php')
-rw-r--r--plugins/processor.magickwand.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/processor.magickwand.php b/plugins/processor.magickwand.php
index 7517bc5..0da769b 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.10 2007/07/29 14:23:25 squareing Exp $
+ * $Header: /cvsroot/bitweaver/_bit_liberty/plugins/processor.magickwand.php,v 1.11 2007/09/25 15:36:09 squareing Exp $
*
* Image processor - extension: php-magickwand
* @package liberty
@@ -47,6 +47,8 @@ function liberty_magickwand_resize_image( &$pFileHash, $pThumbnail = FALSE ) {
MagickSetImageCompressionQuality( $magickWand, 85 );
$iwidth = round( MagickGetImageWidth( $magickWand ) );
$iheight = round( MagickGetImageHeight( $magickWand ) );
+ vd($iwidth);
+ vd($iheight);
// this does not seem to be needed. magickwand will work out what to do by using the destination file extension
//MagickSetImageFormat( $magickWand, $format );
@@ -54,13 +56,13 @@ function liberty_magickwand_resize_image( &$pFileHash, $pThumbnail = FALSE ) {
if( empty( $pFileHash['max_width'] ) || empty( $pFileHash['max_height'] ) || $pFileHash['max_width'] == MAX_THUMBNAIL_DIMENSION || $pFileHash['max_height'] == MAX_THUMBNAIL_DIMENSION ) {
$pFileHash['max_width'] = $iwidth;
$pFileHash['max_height'] = $iheight;
- } elseif( (($iwidth / $iheight) < 1) && !empty( $pFileHash['max_width'] ) && !empty( $pFileHash['max_height'] ) ) {
+ } elseif(( $iwidth / $iheight ) < 1 && !empty( $pFileHash['max_width'] ) && !empty( $pFileHash['max_height'] )) {
// we have a portrait image, flip everything
$temp = $pFileHash['max_width'];
$pFileHash['max_height'] = $pFileHash['max_width'];
$pFileHash['max_width'] = round( ($iwidth / $iheight) * $pFileHash['max_height'] );
} elseif( !empty( $pFileHash['max_width'] ) ) {
- $pFileHash['max_height'] = round( ($iheight / $iwidth) * $pFileHash['max_width'] );
+ $pFileHash['max_height'] = round(( $iheight / $iwidth ) * $pFileHash['max_width'] );
}
// Make sure not to scale up