Update app.py
Browse files
app.py
CHANGED
@@ -22,7 +22,7 @@ def get_bytes_value(image):
|
|
22 |
images=[]
|
23 |
templates = Jinja2Templates(directory="templates")
|
24 |
@app.get("/image",response_class=Response)
|
25 |
-
def img(request: Request
|
26 |
return b64.b64decode(images[0]) if len(images)>0 else "No image"
|
27 |
@app.get("/",response_class=HTMLResponse)
|
28 |
def test(request: Request,q:str="ls",body:bool=True):
|
@@ -32,6 +32,7 @@ def test(request: Request,q:str="ls",body:bool=True):
|
|
32 |
if r.stderr:
|
33 |
return r.stderr
|
34 |
else:
|
|
|
35 |
images=convert_from_path("v.pdf")
|
36 |
images[0].save("v.jpg",format="JPEG")
|
37 |
with open("v.jpg","rb") as t:
|
|
|
22 |
images=[]
|
23 |
templates = Jinja2Templates(directory="templates")
|
24 |
@app.get("/image",response_class=Response)
|
25 |
+
def img(request: Request):
|
26 |
return b64.b64decode(images[0]) if len(images)>0 else "No image"
|
27 |
@app.get("/",response_class=HTMLResponse)
|
28 |
def test(request: Request,q:str="ls",body:bool=True):
|
|
|
32 |
if r.stderr:
|
33 |
return r.stderr
|
34 |
else:
|
35 |
+
global images
|
36 |
images=convert_from_path("v.pdf")
|
37 |
images[0].save("v.jpg",format="JPEG")
|
38 |
with open("v.jpg","rb") as t:
|