mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
Remove some, with Prettier 2.3.0
, unnecessary // prettier-ignore
comments
To get the maximum benefit from something like Prettier, you obviously don't want to disable the automatic formatting unless absolutely necessary. When we added Prettier there were a number of cases, mostly involving larger Arrays, which required disabling of the automatic formatting for overall readability and/or to not break inline comments. With changes in Prettier version `2.3.0`, see [the release notes](https://prettier.io/blog/2021/05/09/2.3.0.html#concise-formatting-of-number-only-arrays-10106httpsgithubcomprettierprettierpull10106-10160httpsgithubcomprettierprettierpull10160-by-thorn0httpsgithubcomthorn0), there's now better formatting support for Arrays containing only numbers. Hence we can now remove a number of `// prettier-ignore` comments, and thus get the benefit of automatic formatting in (slightly) more of the code-base.
This commit is contained in:
parent
faf6b10939
commit
1a8d05fdcf
12 changed files with 212 additions and 270 deletions
|
@ -46,22 +46,22 @@ class EOIMarkerError extends BaseException {}
|
|||
|
||||
// prettier-ignore
|
||||
const dctZigZag = new Uint8Array([
|
||||
0,
|
||||
1, 8,
|
||||
16, 9, 2,
|
||||
3, 10, 17, 24,
|
||||
32, 25, 18, 11, 4,
|
||||
5, 12, 19, 26, 33, 40,
|
||||
48, 41, 34, 27, 20, 13, 6,
|
||||
7, 14, 21, 28, 35, 42, 49, 56,
|
||||
57, 50, 43, 36, 29, 22, 15,
|
||||
23, 30, 37, 44, 51, 58,
|
||||
59, 52, 45, 38, 31,
|
||||
39, 46, 53, 60,
|
||||
61, 54, 47,
|
||||
55, 62,
|
||||
63
|
||||
]);
|
||||
0,
|
||||
1, 8,
|
||||
16, 9, 2,
|
||||
3, 10, 17, 24,
|
||||
32, 25, 18, 11, 4,
|
||||
5, 12, 19, 26, 33, 40,
|
||||
48, 41, 34, 27, 20, 13, 6,
|
||||
7, 14, 21, 28, 35, 42, 49, 56,
|
||||
57, 50, 43, 36, 29, 22, 15,
|
||||
23, 30, 37, 44, 51, 58,
|
||||
59, 52, 45, 38, 31,
|
||||
39, 46, 53, 60,
|
||||
61, 54, 47,
|
||||
55, 62,
|
||||
63
|
||||
]);
|
||||
|
||||
const dctCos1 = 4017; // cos(pi/16)
|
||||
const dctSin1 = 799; // sin(pi/16)
|
||||
|
@ -1158,9 +1158,7 @@ class JpegImage {
|
|||
// inverting JPEG (CMYK) images if and only if the image data does *not*
|
||||
// come from a PDF file and no `decodeTransform` was passed by the user.
|
||||
if (!isSourcePDF && numComponents === 4 && !transform) {
|
||||
// prettier-ignore
|
||||
transform = new Int32Array([
|
||||
-256, 255, -256, 255, -256, 255, -256, 255]);
|
||||
transform = new Int32Array([-256, 255, -256, 255, -256, 255, -256, 255]);
|
||||
}
|
||||
|
||||
if (transform) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue