Member edit implementation done. Recover previous picture added.

This commit is contained in:
Jordan ERNST 2019-03-01 14:52:13 +01:00
parent a500e22678
commit f3f86c43a6

View File

@ -15,6 +15,7 @@ from pywinauto.findwindows import find_window
from pywinauto.win32functions import SetForegroundWindow
from PIL import Image, ImageDraw, ImageFont
from PyPDF2 import PdfFileReader, PdfFileWriter
import fitz
import subprocess
from shutil import copyfile, move
from pyfiglet import Figlet
@ -437,7 +438,13 @@ def memberdo(choix, member):
picture = getpic()
else:
# We crop pic from the previous card
pass
pdf = fitz.open('PDF.pdf')
page = pdf.loadPage(0)
mat = fitz.Matrix(4.165, 4.165) # To obtain good resolution
pix = page.getPixmap(matrix=mat)
pageimg = Image.frombytes("RGBA", [pix.width, pix.height], pix.samples)
picture = pageimg.crop((47, 49, 343, 378))
barcode = barcode_gen(clientID)
fillcard(clientID, titrename, firstname, dateexp, barcode, picture)