We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ca86882 + 6085cf8 commit 0a31134Copy full SHA for 0a31134
textractor/textractor.py
@@ -842,6 +842,7 @@ def _image_to_byte_array(image: Image) -> bytes:
842
:rtype: bytes
843
"""
844
img_byte_arr = io.BytesIO()
845
- image.convert("RGB").save(img_byte_arr, format="JPEG")
+ # We set quality to 95 and subsampling to 0 because the pillow defaults are very low resolution
846
+ image.convert("RGB").save(img_byte_arr, format="JPEG", quality=95, subsampling=0)
847
img_byte_arr = img_byte_arr.getvalue()
848
return img_byte_arr
0 commit comments