From 84fa3db68a6d298835fc00e6740c6a4dc9451f62 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Sun, 30 Jan 2022 20:33:06 +0100 Subject: [PATCH] Fix TGA file writing on Windows Before this patch, the tga_encoder mod would write corrupted TGA files on Windows: Bytes that looked like newlines were replaced by a carriage return and a newline. --- mods/CORE/tga_encoder/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/CORE/tga_encoder/init.lua b/mods/CORE/tga_encoder/init.lua index 39309c9c91..24ec502e1e 100644 --- a/mods/CORE/tga_encoder/init.lua +++ b/mods/CORE/tga_encoder/init.lua @@ -84,7 +84,7 @@ function image:encode() end function image:save(filename) - local f = assert(io.open(filename, "w")) + local f = assert(io.open(filename, "wb")) f:write(self.data) f:close() end