Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pdf-miner
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Qin Kaijie
pdf-miner
Commits
4ec8466e
Unverified
Commit
4ec8466e
authored
Aug 09, 2024
by
Xiaomeng Zhao
Committed by
GitHub
Aug 09, 2024
Browse files
Options
Browse Files
Download
Plain Diff
合并来自myhloli/master的拉取请求#379
fix(doc-analyze): adjust image scaling limit to 9000 pixels
parents
f3ad9be3
445a397f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
doc_analyze_by_custom_model.py
magic_pdf/model/doc_analyze_by_custom_model.py
+2
-2
No files found.
magic_pdf/model/doc_analyze_by_custom_model.py
View file @
4ec8466e
...
...
@@ -37,8 +37,8 @@ def load_images_from_pdf(pdf_bytes: bytes, dpi=200) -> list:
mat
=
fitz
.
Matrix
(
dpi
/
72
,
dpi
/
72
)
pm
=
page
.
get_pixmap
(
matrix
=
mat
,
alpha
=
False
)
#
if width or height > 3000 pixels, don't enlarge the image
if
pm
.
width
>
3000
or
pm
.
height
>
3
000
:
#
If the width or height exceeds 9000 after scaling, do not scale further.
if
pm
.
width
>
9000
or
pm
.
height
>
9
000
:
pm
=
page
.
get_pixmap
(
matrix
=
fitz
.
Matrix
(
1
,
1
),
alpha
=
False
)
img
=
Image
.
frombytes
(
"RGB"
,
(
pm
.
width
,
pm
.
height
),
pm
.
samples
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment