From 87f3403dfcfa008070f69fe588e1e108c001fe27 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Thu, 23 Jul 2026 20:45:22 +0200 Subject: Restyle pdf headline cards --- app/models/concerns/file_attachment.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'app/models') diff --git a/app/models/concerns/file_attachment.rb b/app/models/concerns/file_attachment.rb index 62213123..e577c7fa 100644 --- a/app/models/concerns/file_attachment.rb +++ b/app/models/concerns/file_attachment.rb @@ -98,11 +98,11 @@ module FileAttachment generate_all_variants(original_path) end - def generate_variants(original_path) + def generate_variants(original_path, extra_args = []) STYLES.each do |style, options| dest_path = file_path(style) FileUtils.mkdir_p(File.dirname(dest_path)) - system("magick", original_path, *options[:args], dest_path) + system("magick", original_path, *extra_args, *options[:args], dest_path) end end @@ -120,7 +120,8 @@ module FileAttachment elsif VECTOR_CONTENT_TYPES.include?(upload_content_type) generate_svg_variants(original_path) elsif RASTERIZED_CONTENT_TYPES.include?(upload_content_type) - generate_variants("#{original_path}[0]") + generate_variants("#{original_path}[0]", + ["-background", "white", "-alpha", "remove", "-alpha", "off"]) end end -- cgit v1.3