Sha256: 4904e800e2e08b46e679597834607239d7389eeb4cd9dd931fe28b0df93b094d
Contents?: true
Size: 475 Bytes
Versions: 9
Compression:
Stored size: 475 Bytes
Contents
module RailsAdminJcrop module ImageHelper class << self def crop(img, w, h, x, y) processor = img.class.name =~ /^MiniMagick/ ? 'minimagick' : 'rmagick' send("#{processor}_crop", img, w, h, x, y) end def minimagick_crop(img, w, h, x, y) geometry = "#{w}x#{h}+#{x}+#{y}" img.crop geometry end def rmagick_crop(img, w, h, x, y) img.crop! x.to_i, y.to_i, w.to_i, h.to_i end end end end
Version data entries
9 entries across 9 versions & 1 rubygems