Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

fix(pdf-export): init resized image array

as-opd5766640e7eb
diff --git a/app/models/work_package/pdf_export/attachments.rb b/app/models/work_package/pdf_export/attachments.rb
index 7132e1ba8df..bed1633afe9 100644
--- a/app/models/work_package/pdf_export/attachments.rb
+++ b/app/models/work_package/pdf_export/attachments.rb
@@ -31,6 +31,8 @@ require 'mini_magick'
module WorkPackage::PDFExport::Attachments
def resize_image(file_path)
tmp_file = Tempfile.new(['temp_image', File.extname(file_path)])
+ @resized_images = [] if @resized_images.nil?
+
@resized_images << tmp_file
resized_file_path = tmp_file.path