viliusle / Hermite-resize

Canvas image resize/resample using Hermite filter with JavaScript.
Other
288 stars 46 forks source link

IE10 support #3

Closed prototype23 closed 8 years ago

prototype23 commented 8 years ago

Hi, lovely fast script with nice quality and with no artifacts or halos on transparent images. Thanks for sharing.

I have an issue with ie10.

Resizer fails with a DataCloneError on line 152.

my_worker.postMessage(objData, [objData.source]);

For now i do a try-catch and inform user for unsupported browser like:

var resizer = new Hermite_class();

        try {
            resizer.resample(testCanvas1, canvas.width, canvas.height, true, function () {
                // give canvas to user function
            options.callback(testCanvas1);
             });
        } catch (e) {
            //Errors here
            options.callback(false);
        }

Any other ideas ?

viliusle commented 8 years ago

Don't forget that its 2016 and only IE11 and IE8 is left. Market share for IE10 is ... 0.49% (http://gs.statcounter.com).

But if you still want to support it, use old single core version, that is more stable and don't require new features. HERMITE.resample_single(canvas, width, height);

prototype23 commented 8 years ago

Thanks for your feedback. I will try the resample_single for that browser. Cheers