Merge pull request #27 from Retrospring/bug-image-constraints

Fix image sizes (thanks jpeg)
This commit is contained in:
Andreas N. 2015-07-20 00:51:35 +02:00
commit 6b7a8a5073
1 changed files with 2 additions and 3 deletions

View File

@ -16,12 +16,11 @@ module Paperclip
if target.cropping? if target.cropping?
case @attachment.name case @attachment.name
when :profile_picture when :profile_picture
['-crop', "'#{target.crop_w.to_i}x#{target.crop_h.to_i}+#{target.crop_x.to_i}+#{target.crop_y.to_i}'"] ['-auto-orient', '-strip', '+repage', '-crop', "'#{target.crop_w.to_i}x#{target.crop_h.to_i}+#{target.crop_x.to_i}+#{target.crop_y.to_i}'"]
when :profile_header when :profile_header
['-crop', "'#{target.crop_h_w.to_i}x#{target.crop_h_h.to_i}+#{target.crop_h_x.to_i}+#{target.crop_h_y.to_i}'"] ['-auto-orient', '-strip', '+repage', '-crop', "'#{target.crop_h_w.to_i}x#{target.crop_h_h.to_i}+#{target.crop_h_x.to_i}+#{target.crop_h_y.to_i}'"]
end end
end end
end end
end end
end end