patrick
patrick

Reputation: 16949

Read byte[] from BlobUrl in javascript?

I made a BlobUrl from a Canvas element on my main / DOM thread like this:

 canvas.toBlob(function(blob) {
      photo.src = URL.createObjectURL(blob);
    }, 'image/jpeg', 1);

I send the BlobUrl to my WebWorker. How can I read the byte array in my WebWorker using just BlobUrl? (I am trying to avoid unnecesary copies)

Upvotes: 1

Views: 59

Answers (1)

Walle Cyril
Walle Cyril

Reputation: 3247

To avoid copies, use transferrables.

Upvotes: 1

Related Questions