Skip to content

Instantly share code, notes, and snippets.

View neuberoliveira's full-sized avatar
🐞
deploying new bugs to fix them latter

Neuber Oliveira neuberoliveira

🐞
deploying new bugs to fix them latter
View GitHub Profile
@transitive-bullshit
transitive-bullshit / image-service.js
Last active November 12, 2021 12:22
Angular service to resize images with antialiasing for use with canvas.
angular.module('demo').service('imageService', function ($http, $q, $timeout) {
var NUM_LOBES = 3
var lanczos = lanczosGenerator(NUM_LOBES)
// resize via lanczos-sinc convolution
this.resize = function (img, width, height) {
var self = { }
self.type = "image/png"
self.quality = 1.0