Skip to content

Commit

Permalink
fix image scale result generation
Browse files Browse the repository at this point in the history
  • Loading branch information
omohokcoj committed Dec 7, 2023
1 parent 16a2fde commit a32dcc0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/submissions/generate_result_attachments.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def call(submitter)
scale = [(area['w'] * width) / image.width,
(area['h'] * height) / image.height].min

io = StringIO.new(image.resize([scale * 4, 1].min).write_to_buffer('.png'))
io = StringIO.new(image.resize([scale * 4, 1].select(&:positive?).min).write_to_buffer('.png'))

canvas.image(
io,
Expand Down

0 comments on commit a32dcc0

Please sign in to comment.