Comments (9)
Thanks, @Malli1320! I see the issue now. I will investigate and get back to you.
from cropro.
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.
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.
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.
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
- click image
- rotate 90 deg left or right
- resize the crop rectangle on image
- click save
from cropro.
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.
@ailon
This is what we get for renderAtNaturalSize is enabled
and this is for renderAtNaturalSize is disabled
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.
I will add a limiter that will take aspect ratio into account.
from cropro.
ok, still we need to disable renderAtNaturalSize after you set the limiter?
from cropro.
Related Issues (18)
- Error in popup mode HOT 3
- Close button doesnt work correctly HOT 1
- Contrast and Brightness HOT 1
- Cropping hides buttons on toolbar HOT 1
- Rotate Reduces Resolution HOT 5
- iOS bug around resizing when switching from portrait to landscape back to portrait HOT 4
- Customize ZIndex HOT 2
- "Tainted canvases may not be exported" HOT 1
- CropAreaState's cropRect x/y is always 20 pixels off HOT 2
- Request: make `CropArea.render` public like in markerjs2 HOT 2
- Crop handles "slip" out from under mouse cursor often
- The crop area jumps unpredictably HOT 11
- Using renderAtNaturalSize with flip actions causes a corrupted image HOT 2
- Editor opens very slow and feels like an infinity loop HOT 5
- Feature: `uiOffsetTop` and `uiOffsetLeft` HOT 6
- Add aria-label and data-action attributes HOT 1
- cropArea not resetting after image rotation HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cropro.