Marthee commited on
Commit
8ec3986
·
verified ·
1 Parent(s): d3102fd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
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)