Skip to content

Commit

Permalink
Fix warning when not set width or height in thumbsizes. Fixes #30.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbasso committed Feb 27, 2010
1 parent 61cc433 commit 5911316
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions models/behaviors/meio_upload.php
Expand Up @@ -36,7 +36,6 @@ class MeioUploadBehavior extends ModelBehavior {
// Place any custom thumbsize in model config instead,
),
'thumbnailQuality' => 75, // Global Thumbnail Quality
'maxDimension' => null, // Can be null, h, or w
'useImageMagick' => false,
'imageMagickPath' => '/usr/bin/convert', // Path to imageMagick on your server
'fields' => array(
Expand Down Expand Up @@ -749,10 +748,13 @@ function _createThumbnails(&$model, $data, $fieldName, $saveAs, $ext, $options)
} else {
$thumbSaveAs = $this->_getThumbnailName($saveAs, $options['dir'], $key, $data[$model->alias][$fieldName]['name']);
}
$params = array(
'thumbWidth' => $value['width'],
'thumbHeight' => $value['height']
);
$params = array();
if (isset($value['width'])) {
$params['thumbWidth'] = $value['width'];
}
if (isset($value['height'])) {
$params['thumbHeight'] = $value['height'];
}
if (isset($value['maxDimension'])) {
$params['maxDimension'] = $value['maxDimension'];
}
Expand Down

0 comments on commit 5911316

Please sign in to comment.