You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Crashes with every file larger than aproximately around 200 KB #16
Using angular 1.2.0 I ran into the issue that chrome and also firefox tend to crash for every file a little larger than a few Kilobytes. Any idea how to circumvent that?
executing that particular regular expression on the dataURL.match line takes a great deal of resource - on a 32Gb iMac, it was taking minutes at a time to process a ~1Mb file, and could easlly appear as if it had crashed. I had to ignore injunctions to kill the page 3 or 4 times but it does complete eventually.
Fortunately the fix is easy, using the DataURI spec. as a reference, just replace the match with a simple substring:
var doResizing = function(imageResult, callback) {
createImage(imageResult.url, function(image) {
var dataURL = resizeImage(image, scope);
var imageType = dataURL.substring(5, dataURL.indexOf(';'));
imageResult.resized = {
dataURL: dataURL,
type: imageType
};
callback(imageResult);
});
};
This has reduced the processing time to < 1 sec. for everything I've tried it on so far.
Hi, unless I've made a mess of it, I should already have added one, PR#25 I think? Unfamiliar with the process so apologies if I've got things out of sequence.
Activity
mrsean2k commentedon Mar 14, 2014
I'm not certain if this is the same issue, but on Chrome / Angular, the performance drops off severely for even moderately sized images.
I believe I've traced the issue to the doResizing function:
executing that particular regular expression on the dataURL.match line takes a great deal of resource - on a 32Gb iMac, it was taking minutes at a time to process a ~1Mb file, and could easlly appear as if it had crashed. I had to ignore injunctions to kill the page 3 or 4 times but it does complete eventually.
Fortunately the fix is easy, using the DataURI spec. as a reference, just replace the match with a simple substring:
This has reduced the processing time to < 1 sec. for everything I've tried it on so far.
boxxxie commentedon Mar 18, 2014
can you do a PR?
mrsean2k commentedon Mar 18, 2014
Hi, unless I've made a mess of it, I should already have added one, PR#25 I think? Unfamiliar with the process so apologies if I've got things out of sequence.
boxxxie commentedon Mar 18, 2014
sorry, i don't see the PR being referred to in this issue. so it wasn't obvious.
#25
000a7ff