Impact icon indicating copy to clipboard operation
Impact copied to clipboard

"ctx.getImageDataHD" is not a thing

Open Joncom opened this issue 6 years ago • 2 comments

This method doesn't actually exist. It's undefined...

https://github.com/phoboslab/Impact/blob/66e872e26a62a6f3f1f984c3fb004ec74d29784a/lib/impact/impact.js#L214

https://github.com/phoboslab/Impact/blob/66e872e26a62a6f3f1f984c3fb004ec74d29784a/lib/impact/impact.js#L224-L226

Joncom avatar Aug 06 '19 16:08 Joncom

getImageDataHD is actually webkitGetImageDataHD and present on retina Apple devices.

https://developer.apple.com/documentation/webkitjs/canvasrenderingcontext2d/1633452-webkitgetimagedatahd

city41 avatar Dec 22 '19 06:12 city41

ig.normalizeVendorAttribute would have provided webkitGetImageDataHD as getImageDataHD on the ctx.

Safari used to automatically pixel double the internal resolution of the canvas on "retina" devices. I wrote an article about this whole ordeal back then.

However, this is all obsolete as far as I know. Safari it no longer does this. If you ask for a 320x240 Canvas, you now really get an internal resolution of 320x240. The backingStorePixelRatio is always 1. Same with all(?) other browsers. So the whole getImagePixels function could probably be simplified.

phoboslab avatar Dec 22 '19 09:12 phoboslab