Foliotek / Croppie

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

Cropped Image has vertical row of Missing Pixels on Right / Image Shift when Zoomed #567

Open redluss opened 6 years ago

redluss commented 6 years ago

Expected Behavior

User should be able to zoom in and out on a picture without it moving.

Actual Behavior

Moving the zoom slider even 1 notch causes the image to jump several pixels left, which results in a blank strip being output in the final file on the right side of the viewport. In the case of my example (which does not actually write the file), a 400x400 pixel image is output, but a gap of appx 68 pixels occurs on the right side of the image.

Steps to Reproduce the Problem

  1. https://jsfiddle.net/xpvt214o/770382/
  2. Upload a picture (preferably with something that you can reference the right and left sides on)
  3. Move the zoom slider one notch and notice how the image jumps.
  4. In a version of the page that I use where the image is then written as a file, that shift represents the pixels that are missing in the final image. I have verified if I write the file without touching the zoom, that the image writes correctly.

Example Link

Specifications

Left image is what was saved into after the crop, right image is what it looked like when submitted. If the image was at it's right-most boundary, the pixels would be missing and cut off. screen shot 2018-09-10 at 7 54 53 pm

iomzed commented 5 years ago

Hi I have the same issue. Have someone found a workaround this?

phi-khanh2k commented 4 years ago

Hi I have the same issue. Have someone found a workaround this?