summaryrefslogtreecommitdiff
path: root/plugins/processor.magickwand.php
diff options
context:
space:
mode:
authorspiderr <spider@viovio.com>2012-07-19 14:43:41 -0400
committerspiderr <spider@viovio.com>2012-07-19 14:43:41 -0400
commit3f3a8974b942fb68c7941e5c5f8db70231977906 (patch)
treec280a3a2cb963b4a1c8658d16c19430362e5d055 /plugins/processor.magickwand.php
parent4b8f9526bf923f7f14af14873ec06279b741908c (diff)
downloadliberty-3f3a8974b942fb68c7941e5c5f8db70231977906.tar.gz
liberty-3f3a8974b942fb68c7941e5c5f8db70231977906.tar.bz2
liberty-3f3a8974b942fb68c7941e5c5f8db70231977906.zip
rework upload files to have an option to save as original.ext, file_name is still recorded in the database properly. rework PDF thumbnailing.
Diffstat (limited to 'plugins/processor.magickwand.php')
-rw-r--r--plugins/processor.magickwand.php18
1 files changed, 1 insertions, 17 deletions
diff --git a/plugins/processor.magickwand.php b/plugins/processor.magickwand.php
index 4c06fe9..8b8cac0 100644
--- a/plugins/processor.magickwand.php
+++ b/plugins/processor.magickwand.php
@@ -22,20 +22,8 @@ function liberty_magickwand_resize_image( &$pFileHash ) {
$magickWand = NewMagickWand();
$pFileHash['error'] = NULL;
$ret = NULL;
- $isPdf = preg_match( '/pdf/i', $pFileHash['type'] );
+
if( !empty( $pFileHash['source_file'] ) && is_file( $pFileHash['source_file'] ) && filesize( $pFileHash['source_file'] ) ) {
- // This has to come BEFORE the MagickReadImage
- if( $isPdf ) {
- // has a customer pdf rasterization function been defined?
- if( function_exists( 'liberty_rasterize_pdf' ) && $rasteredFile = liberty_rasterize_pdf( $pFileHash['source_file'] ) ) {
- $pFileHash['source_file'] = $rasteredFile;
- $isPdf = FALSE;
- } else {
- MagickSetImageUnits( $magickWand, MW_PixelsPerInchResolution );
- $rez = empty( $pFileHash['max_width'] ) || $pFileHash['max_width'] == MAX_THUMBNAIL_DIMENSION ? 250 : 72;
- MagickSetResolution( $magickWand, 300, 300 );
- }
- }
if( $error = liberty_magickwand_check_error( MagickReadImage( $magickWand, $pFileHash['source_file'] ), $magickWand ) ) {
// $pFileHash['error'] = $error;
$destFile = liberty_process_generic( $pFileHash, FALSE );
@@ -48,10 +36,6 @@ function liberty_magickwand_resize_image( &$pFileHash ) {
MagickSetImageColorspace( $magickWand, MW_RGBColorspace );
$pFileHash['colorspace_conversion'] = TRUE;
}
- if( $isPdf ) {
- MagickResetIterator( $magickWand );
- MagickNextImage( $magickWand );
- }
MagickSetImageCompressionQuality( $magickWand, $gBitSystem->getConfig( 'liberty_thumbnail_quality', 85 ));
$iwidth = round( MagickGetImageWidth( $magickWand ) );
$iheight = round( MagickGetImageHeight( $magickWand ) );