Jump to content

CanvasPixelArray / Uint8ClampedArray browser support


James Cat
 Share

Recommended Posts

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

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...