I hereby claim:
- I am doomlerd on github.
- I am doomlord (https://keybase.io/doomlord) on keybase.
- I have a public key ASBUvJgqwDRvq5C0a5GCFpZ7yFLC2gwE21kU0AmSB57JLQo
To claim this, I am signing this object:
function scaleImage(url, width = 1024, quality = 1.0) { | |
let img = new Image(); | |
img.onload = function () { | |
let canvas = document.createElement("canvas"), | |
context = canvas.getContext("2d"); | |
canvas.width = width; | |
canvas.height = width * (img.height / img.width); | |
context.drawImage(img, 0, 0, canvas.width, canvas.height); | |
return canvas.toDataURL('image/jpeg', quality); | |
}; |
I hereby claim:
To claim this, I am signing this object:
// Made by Oliver Lenehan, @sunsetkookaburra | |
// --allow-read --allow-write subsystem.ts [target] | |
if(!Deno.args[0]) Deno.exit(1); | |
async function readN(r: Deno.Reader, n: number): Promise<Uint8Array | null> { | |
const buf = new Uint8Array(n); | |
let nRead = 0; | |
// a null value of r.read() will nullish coalesce into NaN and | |
// polute nRead, causing (nRead < n) to be false and the loop to exit |