Foliotek / Croppie

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

Croppie - Zooming out goes further than viewport dimensions #729

Open michael-ugolini opened 4 years ago

michael-ugolini commented 4 years ago

Expected Behavior

We are using Croppie.js for image upload on one of our Angular projects. Expected behavior is to use use the slider to zoom out as far as the view port and boundary allows me to without the specified image zooming further out than the viewport itself, creating a white space on the side considered within the cropped space.

Actual Behavior

As I zoom out using the slider or mousewheel, the image exceeds the view port dimensions and tends to display a white space either on the top of the image or both the top or sides. You are also able to save this image with the white space on the sides incorrectly.
Croppie_Issue

I am expecting the image to remain within the view port dimensions and not exceed the limit as croppie examples show. This happens differently every time. For example, I can reload the page on Chrome and it works 100% but try again and the space is showing. Sometimes it shows a little bit and sometimes, as per the image above, a lot.

Steps to Reproduce the Problem

We upload a file using a FileInput to the croppie component which then displays the image available to crop, as per many croppie examples.

Specifications