Initial import

This commit is contained in:
sladecraven 2021-02-01 18:29:17 +01:00
parent eea47e04c5
commit bc14b1b756
1 changed files with 11 additions and 9 deletions

View File

@ -5,15 +5,17 @@ local cmd = 'stl-thumb'
local function parse_one_level( path )
for myfile in lfs.dir(path) do
local attr = lfs.attributes (myfile)
if attr.mode == "directory" then
print("Entering sub folder : ", myfile)
parse_one_level( myfile)
elseif string.match(myfile, "%.stl") or string.match(myfile, "%.STL") then
print("Thumbnail for : ", myfile)
local fullname = rootpath .. myfile
local fullcmd = cmd .. " --format JPG --size 512 " .. fullname .. " " .. fullname .. ".jpg"
os.execute( fullcmd )
if myfile ~= "." and myfile ~= ".." then
local attr = lfs.attributes (myfile)
if attr.mode == "directory" then
print("Entering sub folder : ", myfile)
parse_one_level( myfile)
elseif string.match(myfile, "%.stl") or string.match(myfile, "%.STL") then
print("Thumbnail for : ", myfile)
local fullname = rootpath .. myfile
local fullcmd = cmd .. " --format JPG --size 512 " .. fullname .. " " .. fullname .. ".jpg"
os.execute( fullcmd )
end
end
end
end