aboutsummaryrefslogtreecommitdiffstats
path: root/admin/derivatives.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2012-02-18 20:46:46 +0000
committerrvelices <rv-github@modusoptimus.com>2012-02-18 20:46:46 +0000
commita8938827898ed40d35f25b055a72a41a2c1567ef (patch)
tree4faaa2424bf609938dd526dc6c99cae8d25fdbf7 /admin/derivatives.php
parent3ef9e856c36e7b7b8530beb52c8667945a645cad (diff)
- multisize thumb longest side can be smaller than the square size
- remove unused css, shorten/optimize php called very often (at least theoretically should be faster) git-svn-id: http://piwigo.org/svn/trunk@13240 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/derivatives.php')
-rw-r--r--admin/derivatives.php40
1 files changed, 30 insertions, 10 deletions
diff --git a/admin/derivatives.php b/admin/derivatives.php
index 556ff7fec..283dceb72 100644
--- a/admin/derivatives.php
+++ b/admin/derivatives.php
@@ -52,16 +52,36 @@ if ( isset($_POST['d']) )
if (!$pderivative['enabled'])
continue;
- $v = intval($pderivative['w']);
- if ($v<=0 || $v<=$prev_w)
- {
- $errors[$type]['w'] = '>'.$prev_w;
- }
- $v = intval($pderivative['h']);
- if ($v<=0 || $v<=$prev_h)
- {
- $errors[$type]['h'] = '>'.$prev_h;
- }
+ if ($type==IMG_THUMB)
+ {
+ $w = intval($pderivative['w']);
+ if ($w<=0)
+ {
+ $errors[$type]['w'] = '>0';
+ }
+ $h = intval($pderivative['h']);
+ if ($h<=0)
+ {
+ $errors[$type]['h'] = '>0';
+ }
+ if (max($w,$h) <= $prev_w)
+ {
+ $errors[$type]['w'] = $errors[$type]['h'] = '>'.$prev_w;
+ }
+ }
+ else
+ {
+ $v = intval($pderivative['w']);
+ if ($v<=0 || $v<=$prev_w)
+ {
+ $errors[$type]['w'] = '>'.$prev_w;
+ }
+ $v = intval($pderivative['h']);
+ if ($v<=0 || $v<=$prev_h)
+ {
+ $errors[$type]['h'] = '>'.$prev_h;
+ }
+ }
$v = intval($pderivative['crop']);
if ($v<0 || $v>100)
{