Sha256: 58bd760edb3495ed9c742b0dec5f0c7fcc5674d1a23afd2fdafb4a46851afa6a

Contents?: true

Size: 497 Bytes

Versions: 1

Compression:

Stored size: 497 Bytes

Contents

module LightResizer
  module CarrierWaveResize

    def resize_without_crop(width, height)
      resized_image_path(width, height, false)
    end

    alias_method :resize, :resize_without_crop

    def resize_with_crop(width, height)
      resized_image_path(width, height, true)
    end

    protected

    def resized_image_path(width, height, with_crop)
      File.join(File.dirname(url), 'light_resizer', with_crop ? 'crop' : '', "#{width}x#{height}", file.filename) if url
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
light_resizer-0.2.0 lib/light_resizer/carrierwave_resize.rb