carrierwave-imagesorcery 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -21,7 +21,7 @@ module CarrierWave
21
21
  process :resize_to_fill => [width, height, gravity]
22
22
  end
23
23
 
24
- def resize_and_pad(width, height, background=:transparent, gravity=::Magick::CenterGravity)
24
+ def resize_and_pad(width, height, background=:transparent, gravity='Center')
25
25
  process :resize_and_pad => [width, height, background, gravity]
26
26
  end
27
27
  end
@@ -62,13 +62,8 @@ module CarrierWave
62
62
  def resize_to_limit(width, height)
63
63
  manipulate! do |img|
64
64
  img.manipulate!(:resize => "#{width}x#{height}>")
65
- # img = yield(img) if block_given?
66
- if img
67
- img
68
- else
69
- raise CarrierWave::ProcessingError , I18n.translate(:"errors.messages.imagesorcery_processing_error")
70
- end
71
- # img
65
+ img = yield(img) if block_given?
66
+ img
72
67
  end
73
68
  end
74
69
 
@@ -82,21 +77,15 @@ module CarrierWave
82
77
  # [width (Integer)] the width to scale the image to
83
78
  # [height (Integer)] the height to scale the image to
84
79
  #
85
- #
86
80
  def resize_to_fit(width, height)
87
81
  manipulate! do |img|
88
82
  img.manipulate!(:resize => "#{width}x#{height}")
89
83
  img = yield(img) if block_given?
90
- if img
91
- img
92
- else
93
- raise CarrierWave::ProcessingError , I18n.translate(:"errors.messages.imagesorcery_processing_error")
94
- end
95
- # img
84
+ img
96
85
  end
97
86
  end
98
87
 
99
- ##
88
+ ##
100
89
  # Resize the image to fit within the specified dimensions while retaining
101
90
  # the aspect ratio of the original image. If necessary, crop the image in the
102
91
  # larger dimension.
@@ -107,7 +96,6 @@ module CarrierWave
107
96
  # [height (Integer)] the height to scale the image to
108
97
  # [gravity (String)] the current gravity suggestion (default: 'Center'; options: 'NorthWest', 'North', 'NorthEast', 'West', 'Center', 'East', 'SouthWest', 'South', 'SouthEast')
109
98
  #
110
- #
111
99
  def resize_to_fill(width, height, gravity = 'Center')
112
100
  manipulate! do |img|
113
101
  cols, rows = img.dimensions[:x].to_i, img.dimensions[:y].to_i
@@ -127,7 +115,7 @@ module CarrierWave
127
115
  end
128
116
  end
129
117
 
130
- ##
118
+ ##
131
119
  # Resize the image to fit within the specified dimensions while retaining
132
120
  # the original aspect ratio. If necessary, will pad the remaining area
133
121
  # with the given color, which defaults to transparent (for gif and png,
@@ -1,5 +1,5 @@
1
1
  module CarrierWave
2
2
  module ImageSorcery
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carrierwave-imagesorcery
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-22 00:00:00.000000000 Z
12
+ date: 2012-08-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec