-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue on resize canvas, and then generate data url #3152
Comments
jsfiddle that demonstrate the problem. |
http://jsfiddle.net/qp8x7a5w/17/ here is an example of my case. On iPad, if you select an image, you will see in the console the message "Canvas area exceeds the maximum limit (width * height > 16777216)" when I call the |
each call to setDimensions, or generally changing dimension of the canvas, will kill the context and so the transformation associated with it. For that reason initRetinaScaling is called each time. Is not that the ipad has higher than 2 devicepixel ratio or the browser you use has some inner logic to handle retina? create the canvas without retina, try to export the image and see how bit it is, if from 1200x1200 you get 2400x2400 ipad has automatic retina stuff. |
I don't have the problem on none retina display. The iPad has a devicepixel ration equal to 2. But |
when you resize the canvas retina scaling dies. that is why we reapply it. |
Ok, I made an analyse of what happened when there is a |
strange i thought that during toDataURL for this purpouse enableRetina was set to false. i ll check. |
still does not apply on my macbook i repeat. |
I don't see enableRetinaScaling set to false when I use iOS 9.3.4 on my iPad, and iOS 9.3 Safari on devices is limited to an area of 16777216 pixels (for example, 4096 x 4096). I suspect this is a common number across newer iOS devices |
i get a 2400x2400 image that is the point. i do not get 4800x4800 that is why i m sceptical. |
mmmmmh very weird... And if you debug the callstack, you have 1200x1200 in the But that is the point, the image adding works great, so I also have a 2400x2400 image in my canvas. It's only when I call the |
as soon as i have a bit of time i check it. |
Ok ! If you want me to test some things, tell me ! |
Any news about this problem ? :) |
I made some test about this issue because I have to solve that problem quickly. It seems that if I apply toDataURL directly on the image, it works better. |
ok bug! |
Hello,
I have an issue when I resize the canvas and then call
toDataURL
on iPhone and iPad.I saw that when we call
setWith()
andsetHeight()
, fabric call the functionsetDimensions()
, which call_initRetinaDisplay()
function to apply a pixel ratio on the canvas (x2 on iOS).Then, when I call toDataURL, fabric call again the function
_initRetinaDisplay()
, so the width and height are mutiplied twice (x4 in total). So, I have an error message in the console: "Canvas area exceeds the maximum limit (width * height > 16777216).The text was updated successfully, but these errors were encountered: