don't die when no ratio limits are specified
git-svn-id: file:///home/shish/svn/shimmie2/trunk@790 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
parent
3a2538ad96
commit
c1238af7db
1 changed files with 2 additions and 0 deletions
|
@ -15,6 +15,7 @@ class ResolutionLimit extends Extension {
|
|||
$max_w = $config->get_int("upload_max_width", -1);
|
||||
$max_h = $config->get_int("upload_max_height", -1);
|
||||
$ratios = explode(" ", $config->get_string("upload_ratios", ""));
|
||||
$ratios = array_filter($ratios, "strlen");
|
||||
|
||||
$image = $event->image;
|
||||
|
||||
|
@ -27,6 +28,7 @@ class ResolutionLimit extends Extension {
|
|||
$ok = false;
|
||||
foreach($ratios as $ratio) {
|
||||
$parts = explode(":", $ratio);
|
||||
if(count($parts) < 2) continue;
|
||||
$width = $parts[0];
|
||||
$height = $parts[1];
|
||||
if($image->width / $width == $image->height / $height) {
|
||||
|
|
Reference in a new issue