deathcap / touchup

quick & dirty image manipulation using HTML5 canvas
2 stars 1 forks source link

CanvasRenderingContext2D.webkitImageSmoothingEnabled' is deprecated #2

Open deathcap opened 8 years ago

deathcap commented 8 years ago

Chrome 48.0.2564.103 logs: 'CanvasRenderingContext2D.webkitImageSmoothingEnabled' is deprecated. Please use 'CanvasRenderingContext2D.imageSmoothingEnabled' instead. index.js:32, from:


  scale = function(sourceImage, scaleX, scaleY, algorithm) {
    var canvas, context, destH, destW, _ref;
    destW = sourceImage.width * scaleX;
    destH = sourceImage.width * scaleY;
    _ref = createCanvas(destW, destH), canvas = _ref[0], context = _ref[1];
    if (algorithm === 'nearest-neighbor') {
      context.imageSmoothingEnabled = false;
      context.webkitImageSmoothingEnabled = false;  // here
      context.mozImageSmoothingEnabled = false;
    }
    context.drawImage(sourceImage, 0, 0, destW, destH);
    return canvas.toDataURL();
  };

should the context.webkitImageSmoothingEnabled assignment be removed? (any other browser support to worry about?)