Use Uint8ClampedArray
for the image data returned by JpegDecode
, in src/display/api.js
Since all the built-in PDF.js image decoders now return their data as `Uint8ClampedArray`, for consistency `JpegDecode` on the main-thread should be doing the same thing; follow-up to PR 8778.
This commit is contained in:
parent
47a9d38280
commit
dc6e1b4176
@ -2028,7 +2028,7 @@ var WorkerTransport = (function WorkerTransportClosure() {
|
|||||||
var height = img.height;
|
var height = img.height;
|
||||||
var size = width * height;
|
var size = width * height;
|
||||||
var rgbaLength = size * 4;
|
var rgbaLength = size * 4;
|
||||||
var buf = new Uint8Array(size * components);
|
var buf = new Uint8ClampedArray(size * components);
|
||||||
var tmpCanvas = document.createElement('canvas');
|
var tmpCanvas = document.createElement('canvas');
|
||||||
tmpCanvas.width = width;
|
tmpCanvas.width = width;
|
||||||
tmpCanvas.height = height;
|
tmpCanvas.height = height;
|
||||||
|
Loading…
Reference in New Issue
Block a user