Merge remote-tracking branch 'origin/feature/upgrade_cut_img' into feature/uat-tmp
Showing
1 changed file
with
5 additions
and
5 deletions
| ... | @@ -345,7 +345,7 @@ class PDFHandler: | ... | @@ -345,7 +345,7 @@ class PDFHandler: |
| 345 | # 3.3 碎图分组大于2、全过滤、含特殊filter,特殊处理:整个页面保存为png图片 | 345 | # 3.3 碎图分组大于2、全过滤、含特殊filter,特殊处理:整个页面保存为png图片 |
| 346 | if page_to_png: | 346 | if page_to_png: |
| 347 | page = pdf.loadPage(pno) | 347 | page = pdf.loadPage(pno) |
| 348 | self.page_to_png(page) | 348 | self.page_to_png(page, is_big_img=True) |
| 349 | 349 | ||
| 350 | def title_is_ebank(self, char): | 350 | def title_is_ebank(self, char): |
| 351 | new_char = normalize('NFKC', char) | 351 | new_char = normalize('NFKC', char) |
| ... | @@ -450,7 +450,7 @@ class PDFHandler: | ... | @@ -450,7 +450,7 @@ class PDFHandler: |
| 450 | # 1.页面图片对象数目为0时,保存整个页面为png图片 | 450 | # 1.页面图片对象数目为0时,保存整个页面为png图片 |
| 451 | if self.is_e_pdf or self.is_ebank or len(il) == 0: | 451 | if self.is_e_pdf or self.is_ebank or len(il) == 0: |
| 452 | page = pdf.loadPage(pno) | 452 | page = pdf.loadPage(pno) |
| 453 | self.page_to_png(page) | 453 | self.page_to_png(page, is_big_img=True) |
| 454 | # 2.页面图片对象数目为1时: | 454 | # 2.页面图片对象数目为1时: |
| 455 | # 小图(如电子账单的盖章):保存整个页面为png图片 | 455 | # 小图(如电子账单的盖章):保存整个页面为png图片 |
| 456 | # 大图:提取图片对象 | 456 | # 大图:提取图片对象 |
| ... | @@ -459,13 +459,13 @@ class PDFHandler: | ... | @@ -459,13 +459,13 @@ class PDFHandler: |
| 459 | # 小图 | 459 | # 小图 |
| 460 | if width < WH_COUPLE_1[0] and height < WH_COUPLE_1[1]: | 460 | if width < WH_COUPLE_1[0] and height < WH_COUPLE_1[1]: |
| 461 | page = pdf.loadPage(pno) | 461 | page = pdf.loadPage(pno) |
| 462 | self.page_to_png(page) | 462 | self.page_to_png(page, is_big_img=True) |
| 463 | # 大图 | 463 | # 大图 |
| 464 | elif width >= WH_COUPLE_6[0] or height >= WH_COUPLE_6[1]: | 464 | elif width >= WH_COUPLE_6[0] or height >= WH_COUPLE_6[1]: |
| 465 | self.is_new_modify = 1 | 465 | self.is_new_modify = 1 |
| 466 | is_big_img = (width < WH_COUPLE_7[0] and height < WH_COUPLE_7[1]) # 防止图片过大 | 466 | is_big_img = (width < WH_COUPLE_7[0] and height < WH_COUPLE_7[1]) # 防止图片过大 |
| 467 | page = pdf.loadPage(pno) | 467 | page = pdf.loadPage(pno) |
| 468 | self.page_to_png(page, is_big_img=is_big_img) | 468 | self.page_to_png(page, is_big_img=True) |
| 469 | elif xref not in self.xref_set: | 469 | elif xref not in self.xref_set: |
| 470 | self.extract_single_image(pdf, xref, smask, colorspace, pno) | 470 | self.extract_single_image(pdf, xref, smask, colorspace, pno) |
| 471 | # 3.页面图片对象数目大于1时,特殊处理 | 471 | # 3.页面图片对象数目大于1时,特殊处理 |
| ... | @@ -480,7 +480,7 @@ class PDFHandler: | ... | @@ -480,7 +480,7 @@ class PDFHandler: |
| 480 | with fitz.Document(self.path) as pdf: | 480 | with fitz.Document(self.path) as pdf: |
| 481 | for pno in range(pdf.pageCount): | 481 | for pno in range(pdf.pageCount): |
| 482 | page = pdf.loadPage(pno) | 482 | page = pdf.loadPage(pno) |
| 483 | self.page_to_png(page) | 483 | self.page_to_png(page, is_big_img=True) |
| 484 | self.img_count = len(self.img_path_list) | 484 | self.img_count = len(self.img_path_list) |
| 485 | 485 | ||
| 486 | def ebank_draw(self): | 486 | def ebank_draw(self): | ... | ... |
-
Please register or sign in to post a comment