From dc6e1b4176700e8796225afba524bebecab7dfa3 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Tue, 5 Jun 2018 20:29:47 +0200 Subject: [PATCH] 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. --- src/display/api.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/display/api.js b/src/display/api.js index cce2704b0..ce3713afa 100644 --- a/src/display/api.js +++ b/src/display/api.js @@ -2028,7 +2028,7 @@ var WorkerTransport = (function WorkerTransportClosure() { var height = img.height; var size = width * height; var rgbaLength = size * 4; - var buf = new Uint8Array(size * components); + var buf = new Uint8ClampedArray(size * components); var tmpCanvas = document.createElement('canvas'); tmpCanvas.width = width; tmpCanvas.height = height;