Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
周伟奇
/
bmw-ocr
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
f83bf474
authored
2021-11-04 10:21:59 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix bug
1 parent
92b21d6a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
src/apps/doc/management/commands/folder_wsc_process.py
src/common/tools/pdf_to_img.py
src/apps/doc/management/commands/folder_wsc_process.py
View file @
f83bf47
...
...
@@ -457,7 +457,7 @@ class Command(BaseCommand, LoggerMixin):
wb
=
BSWorkbook
(
set
(),
set
(),
set
(),
set
(),
set
())
ws
=
wb
.
create_sheet
(
self
.
sheet_name
)
row_idx
=
1
row_idx
=
0
code_idx
=
1
mode_code
=
None
for
write_field
,
field_value
in
results
.
items
():
...
...
src/common/tools/pdf_to_img.py
View file @
f83bf47
...
...
@@ -34,6 +34,7 @@ class PDFHandler:
self
.
img_suffixs
=
{
'.jpeg'
,
'.jpg'
,
'.png'
,
'.webp'
,
'.bmp'
}
self
.
suffix
=
self
.
get_suffix
(
document_name
)
self
.
is_ebank
=
False
self
.
is_e_pdf
=
False
self
.
page_text_list
=
[]
def
get_suffix
(
self
,
file_name
):
...
...
@@ -293,7 +294,8 @@ class PDFHandler:
# 'text': text_list
# }
# )
self
.
is_ebank
=
True
# self.is_ebank = True
self
.
is_e_pdf
=
True
# self.page_text_list = page_text_list
def
extract_image
(
self
,
max_img_count
=
None
):
...
...
@@ -316,7 +318,7 @@ class PDFHandler:
# (xref, smask, width, height, bpc, colorspace, alt.colorspace, name, filter, invoker)
# 1.页面图片对象数目为0时,保存整个页面为png图片
if
self
.
is_ebank
or
len
(
il
)
==
0
:
if
self
.
is_e
_pdf
or
self
.
is_e
bank
or
len
(
il
)
==
0
:
page
=
pdf
.
loadPage
(
pno
)
self
.
page_to_png
(
page
)
# 2.页面图片对象数目为1时:
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment