From 84295c56c462905b4ec05765da667818399b0fa2 Mon Sep 17 00:00:00 2001 From: ssdaniel24 Date: Sun, 11 Jan 2026 11:37:59 +0300 Subject: [PATCH] Added TODO: for gzip decompressing --- mods/API/ApiLoader/src/Api/ff2lua.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mods/API/ApiLoader/src/Api/ff2lua.lua b/mods/API/ApiLoader/src/Api/ff2lua.lua index 2334565..74a16b1 100644 --- a/mods/API/ApiLoader/src/Api/ff2lua.lua +++ b/mods/API/ApiLoader/src/Api/ff2lua.lua @@ -58,6 +58,10 @@ function Api.ff2luat(filepath, backgroundColor) if not file then error('Can\'t open farbfeld image: ' .. dump(filepath)) end local ff = file:read('*a') -- binary! file:close() + -- TODO: make it decompressing gzip format -> https://en.wikipedia.org/wiki/Gzip + -- I should skip 10 bytes in a beginning, read how many extra fields after it, skip them too, and skip last 8 bytes + -- (read wiki for information). + -- if filepath:sub(-3) == '.gz' then ff = core.decompress(ff, 'deflate') end if not ff:sub(1,8) == 'farbfeld' then error('Not farbfeld image: ' .. dump(filepath)) end if not backgroundColor then backgroundColor = '#000000FF' end