Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -211,6 +211,8 @@ def plan2img(nameofpdf):
|
|
| 211 |
data = res.content
|
| 212 |
doc = fitz.open("pdf",data)
|
| 213 |
page=doc[0]
|
|
|
|
|
|
|
| 214 |
pix = page.get_pixmap(dpi=300) # render page to an image
|
| 215 |
pl=Image.frombytes('RGB', [pix.width,pix.height],pix.samples)
|
| 216 |
img=np.array(pl)
|
|
|
|
| 211 |
data = res.content
|
| 212 |
doc = fitz.open("pdf",data)
|
| 213 |
page=doc[0]
|
| 214 |
+
if page.rotation!=0:
|
| 215 |
+
page.set_rotation(0)
|
| 216 |
pix = page.get_pixmap(dpi=300) # render page to an image
|
| 217 |
pl=Image.frombytes('RGB', [pix.width,pix.height],pix.samples)
|
| 218 |
img=np.array(pl)
|