Foliotek / Croppie

A Javascript Image Cropper
http://foliotek.github.io/Croppie
MIT License
2.56k stars 884 forks source link

Feature request: Allow image to be smaller than viewport #670

Closed datdinhquoc closed 5 years ago

datdinhquoc commented 5 years ago

Not an issue or bug, but a feature request: Currently image can be zoomed out but can't be smaller than viewport. We need option to allow image to be smaller than the viewport.

Use case: Sometimes there are square icons which should be added with blank/white margins.

thedustinsmith commented 5 years ago

http://foliotek.github.io/Croppie/#enforceBoundary

datdinhquoc commented 5 years ago

I found a work-around which is not in documentation: Set the value for 'maxZoom' in new Croppie options. By default this value is 1.5, set it to higher value to zoom out for images even as small as 1 pixel.

new Croppie({
    maxZoom: 50,
    ...
});