Skip to content

Conversation

@manuelnaranjo
Copy link

Adding an extra option canvasimg that lets the user of the library pass a canvas with the image preloaded, this allows for instance to get a rotated picture from a cellphone and display it correctly based on the EXIF header.

A little context, this cordova plugin uses base64 encoded images instead of files, on a Samsung A5 2017 (8 cores, 3GB RAM) rotating a 16MP images takes something like 5 seconds because and all of this time is been spent on generating the base64 string after rotation. I have a change I'm gonna submit to them which is instead of stripping off the rotation exif header and rotate on Java, just add the header and let the browser rotate, as it can use the GPU

With the change to your package I can get a rotated image which I can zoom-in in near realtime.

Adding an extra option canvasimg that lets the user of the library
pass a canvas with the image preloaded, this allows for instance
to get a rotated picture from a cellphone and display it correctly
based on the EXIF header
The caching feature is super nice, but it's actually risky. If you
start creating big enough objects at a high frequency (less than 1
minute) then the cache starts growing and growing which leads to
a memory leak. This is more notoriuous on mobile devices, and
specially when the module is used to display 16MP images.
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

Successfully merging this pull request may close these issues.

1 participant