Skip to content

Commit

Permalink
ccitt: apply misc PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
0xabu committed Sep 6, 2021
1 parent feb031b commit 6b509c5
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions pdfminer/ccitt.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# FOR GROUP 4 FACSIMILE APPARATUS"


import sys
import array
from typing import (Any, Callable, Dict, Iterator, List, MutableSequence,
Optional, Sequence, Union, cast)
Expand Down Expand Up @@ -551,13 +550,13 @@ def close(self) -> bytes:
return self._buf

def output_line(self, y: int, bits: Sequence[int]) -> None:
bytes = array.array('B', [0]*((len(bits)+7)//8))
arr = array.array('B', [0]*((len(bits)+7)//8))
if self.reversed:
bits = [1-b for b in bits]
for (i, b) in enumerate(bits):
if b:
bytes[i//8] += (128, 64, 32, 16, 8, 4, 2, 1)[i % 8]
self._buf += bytes.tobytes()
arr[i//8] += (128, 64, 32, 16, 8, 4, 2, 1)[i % 8]
self._buf += arr.tobytes()
return


Expand Down Expand Up @@ -608,7 +607,3 @@ def close(self) -> None:
parser.close()
fp.close()
return


if __name__ == '__main__':
main(sys.argv)

0 comments on commit 6b509c5

Please sign in to comment.