diff options
author | plegall <plg@piwigo.org> | 2016-02-09 17:57:42 +0100 |
---|---|---|
committer | plegall <plg@piwigo.org> | 2016-02-09 17:57:42 +0100 |
commit | a35c7bdf18ef2e74738a0867b70aab18aa48ec9f (patch) | |
tree | bee7ad39b46c6753ad458bb4a57ae6f87596c0e9 /include | |
parent | c4b7977a4272e7e7dedc2adc7d2b2e18867ef27a (diff) | |
parent | c67bf030d1e99c8c0ddbce9e3d84336a333597bd (diff) |
Merge branch 'feature/410-pwg.categories.getList-thumbnail_size'
Diffstat (limited to 'include')
-rw-r--r-- | include/ws_functions/pwg.categories.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/ws_functions/pwg.categories.php b/include/ws_functions/pwg.categories.php index 5bafaf5da..f55a7a773 100644 --- a/include/ws_functions/pwg.categories.php +++ b/include/ws_functions/pwg.categories.php @@ -181,6 +181,11 @@ function ws_categories_getList($params, &$service) { global $user, $conf; + if (!in_array($params['thumbnail_size'], array_keys(ImageStdParams::get_defined_type_map()))) + { + return new PwgError(WS_ERR_INVALID_PARAM, "Invalid thumbnail_size"); + } + $where = array('1=1'); $join_type = 'INNER'; $join_user = $user['id']; @@ -366,7 +371,7 @@ SELECT id, path, representative_ext, level { if ($row['level'] <= $user['level']) { - $thumbnail_src_of[$row['id']] = DerivativeImage::thumb_url($row); + $thumbnail_src_of[$row['id']] = DerivativeImage::url($params['thumbnail_size'], $row); } else { @@ -411,7 +416,7 @@ SELECT id, path, representative_ext while ($row = pwg_db_fetch_assoc($result)) { - $thumbnail_src_of[ $row['id'] ] = DerivativeImage::thumb_url($row); + $thumbnail_src_of[ $row['id'] ] = DerivativeImage::url($params['thumbnail_size'], $row); } } } |