From e267a17c76454d0ea1e09c21d569011e2cf9abf5 Mon Sep 17 00:00:00 2001 From: Cyberarm Date: Mon, 7 Feb 2022 13:31:35 -0600 Subject: [PATCH] Fixed crash on Windows due to not ensuring file mode is binary for saving app icons --- Gemfile.lock | 2 ++ lib/ico.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 6803f31..2e628ca 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -35,6 +35,7 @@ GEM rake (>= 12.0.0, < 14.0.0) excon (0.78.1) ffi (1.15.5) + ffi (1.15.5-x64-mingw-ucrt) ffi (1.15.5-x64-mingw32) fiber-local (1.0.0) gosu (1.4.1) @@ -61,6 +62,7 @@ GEM timers (4.3.3) PLATFORMS + x64-mingw-ucrt x64-mingw32 x86_64-linux diff --git a/lib/ico.rb b/lib/ico.rb index 4f25c61..123d70a 100644 --- a/lib/ico.rb +++ b/lib/ico.rb @@ -134,7 +134,7 @@ class W3DHub if image_bmp?(image) to_rgba32_blob(image).save(filename) else - File.write(filename, image_data(image)) + File.open(filename, "wb") { |f| f.write(image_data(image)) } end end end