summaryrefslogtreecommitdiff
path: root/app/models/concerns
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-07-23 20:45:22 +0200
committererdgeist <erdgeist@erdgeist.org>2026-07-23 20:45:22 +0200
commit87f3403dfcfa008070f69fe588e1e108c001fe27 (patch)
tree2a1af10cc692a72de21dc6c3108e2be5b0067e23 /app/models/concerns
parentf0745de7f661a27b4d20d2ba317d1b31bf9a6c4b (diff)
Restyle pdf headline cards
Diffstat (limited to 'app/models/concerns')
-rw-r--r--app/models/concerns/file_attachment.rb7
1 files changed, 4 insertions, 3 deletions
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
98 generate_all_variants(original_path) 98 generate_all_variants(original_path)
99 end 99 end
100 100
101 def generate_variants(original_path) 101 def generate_variants(original_path, extra_args = [])
102 STYLES.each do |style, options| 102 STYLES.each do |style, options|
103 dest_path = file_path(style) 103 dest_path = file_path(style)
104 FileUtils.mkdir_p(File.dirname(dest_path)) 104 FileUtils.mkdir_p(File.dirname(dest_path))
105 system("magick", original_path, *options[:args], dest_path) 105 system("magick", original_path, *extra_args, *options[:args], dest_path)
106 end 106 end
107 end 107 end
108 108
@@ -120,7 +120,8 @@ module FileAttachment
120 elsif VECTOR_CONTENT_TYPES.include?(upload_content_type) 120 elsif VECTOR_CONTENT_TYPES.include?(upload_content_type)
121 generate_svg_variants(original_path) 121 generate_svg_variants(original_path)
122 elsif RASTERIZED_CONTENT_TYPES.include?(upload_content_type) 122 elsif RASTERIZED_CONTENT_TYPES.include?(upload_content_type)
123 generate_variants("#{original_path}[0]") 123 generate_variants("#{original_path}[0]",
124 ["-background", "white", "-alpha", "remove", "-alpha", "off"])
124 end 125 end
125 end 126 end
126 127