nagadomi 9 gadi atpakaļ
vecāks
revīzija
651e8f8ecb
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. 2 2
      web.lua

+ 2 - 2
web.lua

@@ -79,7 +79,7 @@ local CURL_OPTIONS = {
 local CURL_MAX_SIZE = 5 * 1024 * 1024
 local CURL_MAX_SIZE = 5 * 1024 * 1024
 
 
 local function valid_size(x, scale, tta_level)
 local function valid_size(x, scale, tta_level)
-   if scale == 0 then
+   if scale <= 0 then
       local limit = math.pow(math.floor(math.pow(MAX_NOISE_IMAGE / tta_level, 0.5)), 2)
       local limit = math.pow(math.floor(math.pow(MAX_NOISE_IMAGE / tta_level, 0.5)), 2)
       return x:size(2) * x:size(3) <= limit
       return x:size(2) * x:size(3) <= limit
    else
    else
@@ -89,7 +89,7 @@ local function valid_size(x, scale, tta_level)
 end
 end
 local function auto_tta_level(x, scale)
 local function auto_tta_level(x, scale)
    local limit2, limit4, limit8
    local limit2, limit4, limit8
-   if scale == 0 then
+   if scale <= 0 then
       limit2 = math.pow(math.floor(math.pow(MAX_NOISE_IMAGE / 2, 0.5)), 2)
       limit2 = math.pow(math.floor(math.pow(MAX_NOISE_IMAGE / 2, 0.5)), 2)
       limit4 = math.pow(math.floor(math.pow(MAX_NOISE_IMAGE / 4, 0.5)), 2)
       limit4 = math.pow(math.floor(math.pow(MAX_NOISE_IMAGE / 4, 0.5)), 2)
       limit8 = math.pow(math.floor(math.pow(MAX_NOISE_IMAGE / 8, 0.5)), 2)
       limit8 = math.pow(math.floor(math.pow(MAX_NOISE_IMAGE / 8, 0.5)), 2)