James Cat Posted July 3, 2013 Share Posted July 3, 2013 Hi On Moz developer network, under the entry for canvaspixelarray https://developer.mozilla.org/en-US/docs/Web/API/CanvasPixelArray it mentions the switch to uint8clampedarray, but adds: "However, as of April 2012, most browsers still returns CanvasPixelArray and there are very few implementations which return Uint8ClampedArray on ImageData.data." I am finding it difficult to find information about which browsers support Uint8ClampedArray - sites like caniuse.com will tell me if a browser supports typedarrays or canvas but not which browsers return Uint8ClampedArray for ImageData.data anyone have any info that can help me out? Thanks a bunch for any help James Cat Quote Link to comment Share on other sites More sharing options...
xerver Posted July 4, 2013 Share Posted July 4, 2013 Are you finding that browsers with typedArray/Canvas support do not support those specific features? Quote Link to comment Share on other sites More sharing options...
James Cat Posted July 4, 2013 Author Share Posted July 4, 2013 it was a change in spec in April 2012 to introduce the uint8clamped array as the type underlying canvas.context2d.imagedata.data, the other kinds of typedarrays were already in place, so it doesn't automatically follow from typedarray/canvas support. My research so far shows me that friends who have not updated there iPhones/iPads to the most recent release don't work with uint8clamped array, those that have done the last update do work. Not sure where things stand with Android as nearly all my friends have iPhones - myself I have a crummy old HTC which doesn't do any canvas at all. I'm thinking my next project will be DOM based so at least I can play it on my own phone! Quote Link to comment Share on other sites More sharing options...
IvanK Posted July 6, 2013 Share Posted July 6, 2013 As far as I know, Uint8ClampedArray is supported by every browser with Typed Arrays. I have never heard about CanvasPixelArray.Don't trust any statements about browsers, which are more than a year old. And don't trust any third-party specifications, always look at the official specs - http://www.khronos.org/registry/typedarray/specs/latest/ Quote Link to comment Share on other sites More sharing options...
James Cat Posted July 6, 2013 Author Share Posted July 6, 2013 http://www.w3.org/TR/2011/WD-2dcontext-20110525/#canvaspixelarray this is old so safe to ignore? Quote Link to comment Share on other sites More sharing options...
James Cat Posted July 9, 2013 Author Share Posted July 9, 2013 OK so!! I just bought a fresh from virgin mobile android nexus 4 running android 4.2.2 and guess what? Firefox version 22 my code runs fine Chrome mobile version 18 my code does not run fine. inspecting with chrome developer tool => Uncaught TypeError: Object #<CanvasPixelArray> has no method 'set' so I guess I'm not wrong. JC Quote Link to comment Share on other sites More sharing options...
James Cat Posted July 9, 2013 Author Share Posted July 9, 2013 however... once updated to chrome mobile v27 it works ok! lets hope the people at home always update!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.