From 66bb209ad1f45e0a1b93de2964f6bdd98e48a752 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 39309c9c9..24ec502e1 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