1
0
mirror of https://github.com/20kdc/OC-KittenOS.git synced 2024-11-09 03:58:08 +11:00
OC-KittenOS/inst/deflate/compress.lua
2020-03-31 13:23:52 +01:00

15 lines
479 B
Lua

-- This is released into the public domain.
-- No warranty is provided, implied or otherwise.
-- This is a wrapper around (i.e. does not contain) Zopfli.
local frw = require("libs.frw")
return function (data, lexCrunch)
frw.write("tempData.bin", data)
os.execute("zopfli --i1 --deflate -c tempData.bin > tempZopf.bin")
local res = frw.read("tempZopf.bin")
os.execute("rm tempData.bin tempZopf.bin")
return lexCrunch.process(frw.read("deflate/instdeco.lua"), {}), res
end