You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Include it in your CarrierWave Uploader. For example:
121
121
122
-
class AvatarUploader < CarrierWave::Uploader::Base
123
-
include CarrierWave::RMagick
124
-
...
125
-
end
122
+
class AvatarUploader < CarrierWave::Uploader::Base
123
+
include CarrierWave::RMagick
124
+
## ...
125
+
end
126
126
127
127
**To use `mini_magick`, add it in your `Gemfile` as:**
128
128
129
-
gem 'mini_magick' ## Specify appropriate version, if needed
129
+
gem 'mini_magick' ## Specify appropriate version, if needed
130
130
131
131
Run `bundle`
132
132
133
133
Include it in your CarrierWave Uploader. For example:
134
134
135
-
class AvatarUploader < CarrierWave::Uploader::Base
136
-
include CarrierWave::MiniMagick
137
-
...
138
-
end
135
+
class AvatarUploader < CarrierWave::Uploader::Base
136
+
include CarrierWave::MiniMagick
137
+
## ...
138
+
end
139
139
140
140
3. Supports cropping of ONE attachment per model. Can be directly applied on original attachment if no versions exists.
141
141
142
-
process crop: :avatar
142
+
process crop: :avatar
143
143
144
144
4. Supports cropping of MULTIPLE versions of one attachment per model.
145
145
5. In form helpers, by default *original image* is rendered. To render a specific version for cropping pass `version` option. For example:
146
146
147
-
<%= f.cropbox :avatar , version: :medium %>
148
-
<%= f.previewbox :avatar , version: :medium %> ## Pass the same version as specified in cropbox
147
+
<%= f.cropbox :avatar , version: :medium %>
148
+
<%= f.previewbox :avatar , version: :medium %> ## Pass the same version as specified in cropbox
149
149
150
150
6. By default `previewbox` has `100x100` dimensions and `cropbox` defaults to the target geometry for the version.
151
151
`width` and `height` can be specified for these form helpers. BUT If you override ONE of width/height you MUST override both, otherwise passed option would be ignored.
0 commit comments