Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7044761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:26:53+00:00 2026-05-28T02:26:53+00:00

When I run code that deals with imageData being passed to a web worker

  • 0

When I run code that deals with imageData being passed to a web worker and then back, then Firefox works great but Chrome gives “Uncaught Error: DATA_CLONE_ERR: DOM Exception 25”

Searching google suggests that older versions of Chrome used to work?

I checked some more and it seemed as if I needed to run JSON.stringify and JSON.parse on the imagedata before sending it but then it stops working everywhere. The code that works in FF 9 is:

image.js:

var myImageData = context.getImageData(0, 0, canvas.width, canvas.height).data;
var worker = new Worker("http://direct.link/helpers/worker.js");
worker.postMessage(myImageData);  
worker.onmessage = function(event) {
  var value = event.data;
  switch (value.cmd){
    case 'last':
      //doing stuff 
      break;
  default:
      //doing stuff
    });
}

worker.js:

addEventListener('message', function(event) {
  var myImageData = event.data;
  // doing stuff.
  sendItBack(colors);
});
};

    function sendItBack(colors){
    each(colors, function(index, value){
      self.postMessage(value);
    }); 
    self.postMessage({'cmd': 'last'});
    }

What method should I use in order to send this imagedata back and forth the app and the web worker?

Thanks!

EDIT:

If I copy to a regular array then Chrome starts working…

var newImageData = [];
for (var i=0,len=myImageData.length;i<len;++i) newImageData[i] = myImageData[i];

So chrome can’t pass a CanvasPixelArray to a worker but it can pass a regular Array. But firefox can.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T02:26:54+00:00Added an answer on May 28, 2026 at 2:26 am

    Posting this as follow up. I can reproduce your error in case anyone else can answer your question (I can’t unfortunately). I’ve searched the Chromium issues to see if it’s an outstanding bug, but not found anything. Given image processing is one of the more popular uses of WebWorkers I would hope someone can answer you quickly.

    http://jsfiddle.net/gGFSJ/9/

    From Chrome (asterisks added by me):

    window.URL does not exist
    window.WebKitURL does not exist
    using window.webkitURL for URL
    window.BlobBuilder does not exist
    using window.WebKitBlobBuilder for BlobBuilder
    ***Uncaught Error: DATA_CLONE_ERR: DOM Exception 25***
    data=send back.
    data=to worker.
    data=send back.
    data=0.
    

    From Firefox:

    using window.URL for URL
    window.BlobBuilder does not exist
    window.WebKitBlobBuilder does not exist
    window.webkitBlobBuilder does not exist
    using window.MozBlobBuilder for BlobBuilder
    data=send back.
    data=to worker.
    data=send back.
    data=0.
    data=send back.
    data=[object Uint8ClampedArray].
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a java script code that works fine when run through a browser,
I have some Python code that works correctly when I use python.exe to run
I've run into a EXC_BAD_ACCESS with a piece of code that deals with data
i need run code that will create a database and populate tables. i am
I often run into code that has to perform lots of checks and ends
I need to run some code that will fetch some configuration values from the
In the last two days, ive run across code that has php echo'd variables
I have some jQuery/JavaScript code that I want to run only when there is
I frequently have some code that should be run either on a schedule or
I have some code that I'd like to run on a page. My problem

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.