Skip to content

Commit

Permalink
pixelData Uint16Array has 2 bytes/pixel
Browse files Browse the repository at this point in the history
#73 (comment) fixed the RangeError I and others seem to have encountered.
  • Loading branch information
shivasuri committed Oct 31, 2020
1 parent 8b154e9 commit 7b6b581
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ try
var pixelDataElement = dataSet.elements.x7fe00010;
// create a typed array on the pixel data (this example assumes 16 bit unsigned data)
var pixelData = new Uint16Array(dataSet.byteArray.buffer, pixelDataElement.dataOffset, pixelDataElement.length);
var pixelData = new Uint16Array(dataSet.byteArray.buffer, pixelDataElement.dataOffset, pixelDataElement.length / 2);
}
catch(ex)
{
Expand Down

0 comments on commit 7b6b581

Please sign in to comment.