Sha256: e6a2fa447a6a55f079a28ab4418c1c636dc25c7c21943913b8b6cbe6112f5010

Contents?: true

Size: 534 Bytes

Versions: 3

Compression:

Stored size: 534 Bytes

Contents

# -*- encoding : utf-8 -*-
require 'rademade_admin/uploader/photo'

module RademadeAdmin
  module Uploader
    module CropPhoto
      include ::RademadeAdmin::Uploader::Photo

      def crop_image(image_path, params)
        crop( full_image_path(image_path), params[:x], params[:y], params[:w], params[:h] )
      end

      def original_dimensions
        if file && model
          image = Magick::Image.read(file.file).first
          [image.columns, image.rows]
        else
          []
        end
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rademade_admin-0.1.3 lib/rademade_admin/uploader/crop_photo.rb
rademade_admin-0.1.2 lib/rademade_admin/uploader/crop_photo.rb
rademade_admin-0.1.1 lib/rademade_admin/uploader/crop_photo.rb