Skip to content

Latest commit

 

History

History
58 lines (28 loc) · 1.56 KB

carrierwave_resize_to.md

File metadata and controls

58 lines (28 loc) · 1.56 KB

CarrierWave resize_to methods cheatsheeet

Before we start: do not forget include CarrierWave::MiniMagick line for this methods.

Resize to fill

Using: process :resize_to_fill => [200, 150]

Selected rectangle will be fully filled by image. If system will need, image will be resized and croped.

One side using: process :resize_to_fill => [200, 0]

Resize to fit

Using: process :resize_to_fit => [400, 400]

Image will be fit for selected rectangle: will be resized for touching closer side of rectangle, but not croped;

One side using: process :resize_to_fit => [400, nil]

Resize to limit

Using: process :resize_to_limit => [260, 340]

Works like "resize_to_fit", but image can resize only to smaller size (save quality mode).

One side using: process :resize_to_limit => [260, nil]

Examples

Bigger landscape oriented image

Big landscape oriented image

Smaller landscape oriented image

Small landscape oriented image

Bigger square image

Big square image

Smaller square image

Small square image

Bigger portrait oriented image

Big portrait oriented image

Smaller portrait oriented image

Small portrait oriented image