advanced-cropper / react-advanced-cropper

The react cropper library that embraces power of the advanced cropper core to give the possibility to create croppers that exactly suited for your website design
https://advanced-cropper.github.io/react-advanced-cropper/
Other
678 stars 34 forks source link

Reposition Cropper for Progressively Loaded High Resolution Image #55

Open omairnabiel opened 8 months ago

omairnabiel commented 8 months ago

My use case is that I have to load high resolution images that can take upto 10 seconds to load. The work-around is that I initially load a low resolution image and when high resolution image is fetched in background I replace it. There are 2 problems that I'm facing currently.

  1. Whenever the image is replaced using setState there's a flicker for a second
  2. If user has already started moving the cropper on low res image, upon replacing it with high-res image the cropper resets

Is there a way to avoid the flicker and preserve the cropper position? Preserving the cropper is a little challenging as the image height and width for high-res changes dramatically and previously saved coordinates don't fit right. Thanks

Norserium commented 8 months ago

@omairnabiel, well it's interesting issue and I see pretty much ways to resolve it. But there is an important nuance. What should happen if an user tries to crop an image before the high resolution image will be loaded?

Norserium commented 3 months ago

@omairnabiel, any news?