From adb8e45d6728a955f33bc99c05abdc8b488fe05c 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. --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 39309c9c9..24ec502e1 100644 --- a/init.lua +++ b/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