Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
slide-index
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Welter, Felix
slide-index
Commits
c3912e4b
Commit
c3912e4b
authored
Aug 9, 2020
by
felixwelter
Browse files
Options
Downloads
Patches
Plain Diff
Fix folder path
parent
7f373370
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
app.py
+3
-3
3 additions, 3 deletions
app.py
nlp4web_lecture__6_IR1.pdf_27.jpg
+0
-0
0 additions, 0 deletions
nlp4web_lecture__6_IR1.pdf_27.jpg
with
3 additions
and
3 deletions
app.py
+
3
−
3
View file @
c3912e4b
...
@@ -54,7 +54,7 @@ def query():
...
@@ -54,7 +54,7 @@ def query():
page
=
pdf
.
pages
[
result
[
"
page
"
]]
page
=
pdf
.
pages
[
result
[
"
page
"
]]
img_name
=
result
[
"
path
"
][
7
:]
+
"
_
"
+
str
(
result
[
"
page
"
])
+
"
.jpg
"
img_name
=
result
[
"
path
"
][
7
:]
+
"
_
"
+
str
(
result
[
"
page
"
])
+
"
.jpg
"
img_path
=
os
.
path
.
join
(
IMAGE_DIR
,
img_name
)
img_path
=
os
.
path
.
join
(
IMAGE_DIR
,
img_name
)
page
.
to_image
().
save
(
img_
name
)
page
.
to_image
().
save
(
img_
path
)
return
"
slide/
"
+
img_name
return
"
slide/
"
+
img_name
except
:
except
:
return
str
(
sys
.
exc_info
()[
0
]).
replace
(
"
<
"
,
"
-
"
).
replace
(
"
>
"
,
"
-
"
)
return
str
(
sys
.
exc_info
()[
0
]).
replace
(
"
<
"
,
"
-
"
).
replace
(
"
>
"
,
"
-
"
)
...
@@ -63,9 +63,9 @@ def query():
...
@@ -63,9 +63,9 @@ def query():
def
slide
(
img_name
):
def
slide
(
img_name
):
path
=
os
.
path
.
join
(
IMAGE_DIR
,
img_name
)
path
=
os
.
path
.
join
(
IMAGE_DIR
,
img_name
)
if
"
/
"
in
img_name
or
"
\\
"
in
img_name
:
if
"
/
"
in
img_name
or
"
\\
"
in
img_name
:
return
"
bad image name
"
return
"
bad image name
"
,
400
if
not
os
.
path
.
exists
(
path
):
if
not
os
.
path
.
exists
(
path
):
return
"
image not present
"
return
"
image not present
"
,
404
return
send_file
(
path
,
mimetype
=
'
image/jpg
'
)
return
send_file
(
path
,
mimetype
=
'
image/jpg
'
)
...
...
This diff is collapsed.
Click to expand it.
nlp4web_lecture__6_IR1.pdf_27.jpg
deleted
100644 → 0
+
0
−
0
View file @
7f373370
60 KiB
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment