Browse Source

Updated preview and ImageManipulation workflow process to include max height parameters.

pull/105/head
mroy 14 years ago
parent
commit
857dc7ab14
  1. 12
      plugins/ImageManipulation.inc
  2. 2
      workflow_client/plugins/image_resize.inc

12
plugins/ImageManipulation.inc

@ -17,8 +17,14 @@ class ImageManipulation {
function createPreview($parameterArray, $dsid, $file, $file_ext) {
$system = getenv('System');
$file_suffix = '_' . $dsid . '.' . $file_ext;
$height = $parameterArray['height'];
$width = $parameterArray['width'];
$width = $parameterArray['width'];
if (!isset($parameterArray['height'])) {
$height = $width;
} else {
$height = $parameterArray['height'];
}
$returnValue = TRUE;
$output = array();
@ -29,7 +35,7 @@ class ImageManipulation {
}
if (!file_exists($destFile)) {
exec('convert -resize ' . $width . ' -quality 85 "' . $file . '"[0] -strip "' .$destFile . '" 2>&1 &', $output, $returnValue);
exec('convert -resize ' . $width . 'x'.$height.' -quality 85 "' . $file . '"[0] -strip "' .$destFile . '" 2>&1 &', $output, $returnValue);
}
else
$returnValue = '0';

2
workflow_client/plugins/image_resize.inc

@ -39,7 +39,7 @@ class image_resize extends Process {
$returnValue = TRUE;
$output = array();
$command = 'convert -resize '. $parameters['width'] .' -quality 85 '. $file . '[0] -strip '. $file . $file_suffix .' 2>&1 &';
$command = 'convert -resize '. $parameters['width'].(isset($parameters['height'])?'x'.$parameters['height']:'') .' -quality 85 '. $file . '[0] -strip '. $file . $file_suffix .' 2>&1 &';
exec($command, $output, $returnValue);
if (!file_exists($file . $file_suffix)) {

Loading…
Cancel
Save