From 77aef81fc9aeb5e7217eadd4d3410f1224d48985 Mon Sep 17 00:00:00 2001 From: oiorain Date: Thu, 11 May 2017 16:25:00 +0900 Subject: [PATCH] Add `true_size` to opts passed to jcrop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit it seems that without this argument images bigger than the cropbox don’t get cropped properly. --- lib/papercrop/cropbox.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/papercrop/cropbox.rb b/lib/papercrop/cropbox.rb index 2eafa2d..475a6b6 100644 --- a/lib/papercrop/cropbox.rb +++ b/lib/papercrop/cropbox.rb @@ -61,7 +61,8 @@ def parse_jcrop_opts(opts) parsed[:box_width] = original_width if parsed[:box_width].nil? parsed[:aspect_ratio] = @model.send("#{@attachment_name}_aspect") if parsed[:aspect_ratio].nil? parsed[:set_select] = parsed.fetch :set_select, [0, 0, (original_width / 2), (original_height / 2)] - + parsed[:true_size] = [original_width, original_height] + parsed end -end \ No newline at end of file +end