1
0
Fork 0
mirror of synced 2024-05-16 19:02:21 +12:00

fix image size validation in convert.lua

This commit is contained in:
nagadomi 2015-07-11 21:53:45 +09:00
parent d8ca857a82
commit 99db05a753

View file

@ -21,6 +21,7 @@ local function crop_4x(x)
end
local function load_images(list)
local MARGIN = 32
local count = count_lines(list)
local fp = io.open(list, "r")
local x = {}
@ -28,7 +29,7 @@ local function load_images(list)
for line in fp:lines() do
local im = crop_4x(image_loader.load_byte(line))
if im then
if im:size(2) >= settings.crop_size * 2 and im:size(3) >= settings.crop_size * 2 then
if im:size(2) > (settings.crop_size * 2 + MARGIN) and im:size(3) > (settings.crop_size * 2 + MARGIN) then
table.insert(x, im)
end
else