From aae452cc67494d443f10314a9dd791b4e0a0de42 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Tue, 16 Feb 2021 11:02:53 +0000 Subject: [PATCH] gems: update chunky_png And pass it a proper IO object, to avoid "Undefined method `set_encoding`" errors. --- Gemfile.lock | 2 +- .../new_administrateur/attestation_templates_controller.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index bc1daeeac..007e02140 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -165,7 +165,7 @@ GEM chartkick (3.4.0) childprocess (3.0.0) choice (0.2.0) - chunky_png (1.3.11) + chunky_png (1.4.0) clamav-client (3.2.0) coderay (1.1.3) coercible (1.0.0) diff --git a/app/controllers/new_administrateur/attestation_templates_controller.rb b/app/controllers/new_administrateur/attestation_templates_controller.rb index 00d5ea86b..68a06e3a8 100644 --- a/app/controllers/new_administrateur/attestation_templates_controller.rb +++ b/app/controllers/new_administrateur/attestation_templates_controller.rb @@ -60,7 +60,7 @@ module NewAdministrateur def uninterlaced_png(uploaded_file) if uploaded_file&.content_type == 'image/png' - chunky_img = ChunkyPNG::Image.from_io(uploaded_file) + chunky_img = ChunkyPNG::Image.from_io(uploaded_file.to_io) chunky_img.save(uploaded_file.tempfile.to_path, interlace: false) uploaded_file.tempfile.reopen(uploaded_file.tempfile.to_path, 'rb') end