Initial import
This commit is contained in:
parent
eea47e04c5
commit
bc14b1b756
@ -5,15 +5,17 @@ local cmd = 'stl-thumb'
|
|||||||
|
|
||||||
local function parse_one_level( path )
|
local function parse_one_level( path )
|
||||||
for myfile in lfs.dir(path) do
|
for myfile in lfs.dir(path) do
|
||||||
local attr = lfs.attributes (myfile)
|
if myfile ~= "." and myfile ~= ".." then
|
||||||
if attr.mode == "directory" then
|
local attr = lfs.attributes (myfile)
|
||||||
print("Entering sub folder : ", myfile)
|
if attr.mode == "directory" then
|
||||||
parse_one_level( myfile)
|
print("Entering sub folder : ", myfile)
|
||||||
elseif string.match(myfile, "%.stl") or string.match(myfile, "%.STL") then
|
parse_one_level( myfile)
|
||||||
print("Thumbnail for : ", myfile)
|
elseif string.match(myfile, "%.stl") or string.match(myfile, "%.STL") then
|
||||||
local fullname = rootpath .. myfile
|
print("Thumbnail for : ", myfile)
|
||||||
local fullcmd = cmd .. " --format JPG --size 512 " .. fullname .. " " .. fullname .. ".jpg"
|
local fullname = rootpath .. myfile
|
||||||
os.execute( fullcmd )
|
local fullcmd = cmd .. " --format JPG --size 512 " .. fullname .. " " .. fullname .. ".jpg"
|
||||||
|
os.execute( fullcmd )
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user