Skip to content

Commit

Permalink
Merge 1421ace into 44d83d5
Browse files Browse the repository at this point in the history
  • Loading branch information
jlmadurga committed Nov 20, 2019
2 parents 44d83d5 + 1421ace commit efe9a91
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions document_clipper/pdf.py
Expand Up @@ -150,14 +150,10 @@ def get_page_max_dimensions(self, page_tag_node):
return self._str_list_to_int_list(params)

def _convert_to_jpg(self, image_path):
img = Image.open(image_path)
if img.mode != "RGB":
img = img.convert("RGB")
base = os.path.splitext(image_path)[0]
new_image_path = base + '.jpg'
img.save(new_image_path, 'JPEG')
image_path = new_image_path
return image_path
base = os.path.splitext(image_path)[0]
new_image_path = base + '.jpg'
save_image(Image.open(image_path), new_image_path, 'JPEG')
return new_image_path

def _pdf_page_to_text(self, page):
pdftotext_cmd = PDFToTextCommand()
Expand Down
Binary file modified tests/new_pdf.pdf
Binary file not shown.

0 comments on commit efe9a91

Please sign in to comment.