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
@ -15,6 +15,7 @@ class ResolutionLimit extends Extension {
|
|||||||
$max_w = $config->get_int("upload_max_width", -1);
|
$max_w = $config->get_int("upload_max_width", -1);
|
||||||
$max_h = $config->get_int("upload_max_height", -1);
|
$max_h = $config->get_int("upload_max_height", -1);
|
||||||
$ratios = explode(" ", $config->get_string("upload_ratios", ""));
|
$ratios = explode(" ", $config->get_string("upload_ratios", ""));
|
||||||
|
$ratios = array_filter($ratios, "strlen");
|
||||||
|
|
||||||
$image = $event->image;
|
$image = $event->image;
|
||||||
|
|
||||||
@ -27,6 +28,7 @@ class ResolutionLimit extends Extension {
|
|||||||
$ok = false;
|
$ok = false;
|
||||||
foreach($ratios as $ratio) {
|
foreach($ratios as $ratio) {
|
||||||
$parts = explode(":", $ratio);
|
$parts = explode(":", $ratio);
|
||||||
|
if(count($parts) < 2) continue;
|
||||||
$width = $parts[0];
|
$width = $parts[0];
|
||||||
$height = $parts[1];
|
$height = $parts[1];
|
||||||
if($image->width / $width == $image->height / $height) {
|
if($image->width / $width == $image->height / $height) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user