heic2any
heic2any copied to clipboard
Memory leak in decodeBuffer
The following code creates a new function reference and never frees it.
https://github.com/alexcorvi/heic2any/blob/3222e591896ce72cf293a37f5a083cde5fc348c7/src/heic2any.ts#L202-L212
Subsequent calls to heic2any will create a new instance of the message handler. Both handlers will be called. Converting Nth image will create Nth event handler and all N handler will receive message notifications.
Proposed fix: https://github.com/chebum/heic2any/commit/c6fab0ac088ea988d38d5e9452d9b6a9bb0fe6ed
Fixed heic2any.js is available here: https://github.com/chebum/heic2any/tree/master/dist
The fix also includes pull request #27
Fixed heic2any.js is available here: https://github.com/chebum/heic2any/tree/master/dist
Is there npm of this fork?
Fixed heic2any.js is available here: https://github.com/chebum/heic2any/tree/master/dist
Is there npm of this fork?
You can install it as below:
npm install --save github:chebum/heic2any
thanks for this awesome contribution. as time has gone on now, I see HEIC files taking up 500MB to convert in the browser Memory tab. the end result is the browser is restarted on iOS/Android. desktop browser copes, I guess it has larger memory resource available