Coder Social home page Coder Social logo

Comments (9)

ailon avatar ailon commented on September 28, 2024 2

Thanks, @Malli1320! I see the issue now. I will investigate and get back to you.

from cropro.

ailon avatar ailon commented on September 28, 2024 2

No, the plan is to add a setting that will be the max area size (eg. 2^24) and it will check if the resulting image fits and then downscale if it doesn't.

from cropro.

ailon avatar ailon commented on September 28, 2024 2

I've released v1.5.0 that should mitigate this issue. Set cropArea.renderMaxSize = Math.pow(2, 24); to limit the size to what iOS Safari can handle.

from cropro.

ailon avatar ailon commented on September 28, 2024

Hi. I've played with it for a bit and couldn't reproduce the issue. Could you provide some more details/steps to reproduce? Do you experience the same on the demo page here?

Also, if you see the spinner it feels like there should be some error in the browser's console.

from cropro.

Malli1320 avatar Malli1320 commented on September 28, 2024

Here is the link to reproduce the issue
@ailon https://codesandbox.io/p/sandbox/cropro-all-defaults-demo-forked-2lkll7?file=%2Fsrc%2Findex.js%3A16%2C4

steps to reproduce

  1. click image
  2. rotate 90 deg left or right
  3. resize the crop rectangle on image
  4. click save

from cropro.

ailon avatar ailon commented on September 28, 2024

I've been trying to get to the bottom of this and here's where I am at this point:

Looks like Safari on iOS can't render images with width * height larger than 2^24 (or 16,777,216). When you rotate a large (non-square) image on the side and have renderAtNaturalSize = true it becomes larger than that and Safari craps out silently. A quick workaround would be to disable renderAtNaturalSize or set renderWidth and renderHeight manually. Would that work in your scenario?

I may just add some setting to enable "protection" from this issue by limiting the render size to that max value. I'm not very keen on either applying this across the board or doing some "dirty" user-agent Safari/iOS detection, though.

from cropro.

Malli1320 avatar Malli1320 commented on September 28, 2024

@ailon
This is what we get for renderAtNaturalSize is enabled
Screenshot_20231129_033832

and this is for renderAtNaturalSize is disabled
Screenshot_20231129_033752

Even though if we set renderWidth and rendreHeight we will face the same issue as of now because we will set the original image height and width and again it will exceed the max value.
But in our case we want the cropped image with the original dimension as above when renderAtNaturalSize is enabled, so if we disable the renderAtNaturalSize then what should be the calculation to set proper renderHeight and renderWidth in such a way that we get the image without compromising the quality.

from cropro.

ailon avatar ailon commented on September 28, 2024

I will add a limiter that will take aspect ratio into account.

from cropro.

Malli1320 avatar Malli1320 commented on September 28, 2024

ok, still we need to disable renderAtNaturalSize after you set the limiter?

from cropro.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.