Skip to content
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

Very big images choke. #12

Open
fidergo-stephane-gourichon opened this issue Jul 12, 2013 · 0 comments
Open

Very big images choke. #12

fidergo-stephane-gourichon opened this issue Jul 12, 2013 · 0 comments

Comments

@fidergo-stephane-gourichon

Big images (straight from the camera on certain Apple devices) are reported to be incompletely processed by canvasResize, and memory exhaustion is suspected to be the culprit.

Looking at the code, I see it basically delegates the bulk of the work to HTML canvas drawImage(), which is a good idea (performance-wise -- quality is another matter).
As a side effect, images smaller than 1024x1024 get exactly one call to drawImage() (plus the value added of all your code -- workaround bugs, etc).

In a search for ways to reduce memory consumption, I'm considering reducing tile size (currently set by var d = 1024 in source) to e.g. 512. It would mean 4 times more calls to drawImage(), which should not be a problem, but a 4 times smaller tmpCanvas (256kpixels instead of 1Mpixel), hence reduced memory consumption.

  1. What do you think about this attempts to reduce memory consumption ?
  2. Is the value d=1024 carefully selected with reasons to keep it that way (e.g. browsers known to optimize algorithms for this size) or not ?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant