module Paperclip class Cropper < Thumbnail def transformation_command puts "Crop Command command ====> #{crop_command}" if crop_command puts "Super .join ===> #{super.join}" command = crop_command + super.join(' ').sub(/ -crop \S+/, '').split(" ") puts "Transformation command ====> #{command}" target = @attachment.instance target.crop_w="" target.crop_h="" target.crop_x="" target.crop_y="" return command else super end end def crop_command target = @attachment.instance if target.cropping? ["-crop","#{target.crop_w.to_i}x#{target.crop_h.to_i}+#{target.crop_x.to_i}+#{target.crop_y.to_i}"] end end end end