Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"ctx.getImageDataHD" is not a thing #50

Open
Joncom opened this issue Aug 6, 2019 · 2 comments
Open

"ctx.getImageDataHD" is not a thing #50

Joncom opened this issue Aug 6, 2019 · 2 comments

Comments

@Joncom
Copy link
Collaborator

Joncom commented Aug 6, 2019

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

ig.normalizeVendorAttribute( ctx, 'getImageDataHD' );

Impact/lib/impact/impact.js

Lines 224 to 226 in 66e872e

return (ratio === 1)
? ctx.getImageData( x, y, width, height )
: ctx.getImageDataHD( x, y, width, height );

@Joncom Joncom changed the title "context.getImageDataHD" is not a thing "ctx.getImageDataHD" is not a thing Aug 6, 2019
@city41
Copy link

city41 commented Dec 22, 2019

getImageDataHD is actually webkitGetImageDataHD and present on retina Apple devices.

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

@phoboslab
Copy link
Owner

phoboslab commented Dec 22, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants