Skip to content

Commit 249d7dc

Browse files
committed
finishing fix for path hardcoding problem
1 parent 551cd25 commit 249d7dc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ocr.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def render_ocr(vid_path, view_id, page_number):
138138
prefix=str(pathlib.Path(__file__).parent /'static'/'tmp'), suffix=".jpg", delete=False) as tf:
139139
cv2.imwrite(tf.name, frame_cap)
140140
# "id" is just the name of the temp image file
141-
frame["id"] = tf.name[12:]
141+
frame["id"] = pathlib.Path(tf.name).name
142142

143143
return render_template('ocr.html',
144144
vid_path=vid_path,
@@ -193,4 +193,4 @@ def save_json(dict, view_id):
193193
with tempfile.NamedTemporaryFile(prefix=str(pathlib.Path(__file__).parent /'static'/'tmp'), suffix=".json", delete=False) as tf:
194194
pages_json = open(tf.name, "w")
195195
json.dump(dict, pages_json)
196-
session[f"{view_id}-page-file"] = tf.name
196+
session[f"{view_id}-page-file"] = tf.name

0 commit comments

Comments
 (0)