This commit is contained in:
Sheppy
2018-01-25 03:20:21 +01:00
commit 585a2ea40c
18 changed files with 1115 additions and 0 deletions

12
plot_imageutils.py Normal file
View File

@@ -0,0 +1,12 @@
#!/usr/bin/python3
from config_parse import CFG
from PIL import Image
import math
def check_and_rotate(path):
img = Image.open(path)
div=abs(float(img.size[1])/float(img.size[0])-a4_aspect())/a4_aspect()*100
print("Seitenverhältnisabweichung zu A4: %.2f"%div+r'%')
img.rotate(CFG("image_rotation"),expand=True).save(path.strip(".png")+"_rotated.png")
def a4_aspect():
return 1/math.sqrt(2)