Browse Source

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

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

10
plugins/ImageManipulation.inc

@ -17,8 +17,14 @@ class ImageManipulation {
function createPreview($parameterArray, $dsid, $file, $file_ext) { function createPreview($parameterArray, $dsid, $file, $file_ext) {
$system = getenv('System'); $system = getenv('System');
$file_suffix = '_' . $dsid . '.' . $file_ext; $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; $returnValue = TRUE;
$output = array(); $output = array();
@ -29,7 +35,7 @@ class ImageManipulation {
} }
if (!file_exists($destFile)) { 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 else
$returnValue = '0'; $returnValue = '0';

2
workflow_client/plugins/image_resize.inc

@ -39,7 +39,7 @@ class image_resize extends Process {
$returnValue = TRUE; $returnValue = TRUE;
$output = array(); $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); exec($command, $output, $returnValue);
if (!file_exists($file . $file_suffix)) { if (!file_exists($file . $file_suffix)) {

Loading…
Cancel
Save