1
0
mirror of https://github.com/ciromattia/kcc synced 2025-12-17 19:51:45 +00:00

Fixed No optimization mode (close #88)

This commit is contained in:
Paweł Jastrzębski
2014-04-08 13:10:34 +02:00
parent f32e9560b5
commit 2ee5dc310b

View File

@@ -51,21 +51,27 @@ def buildHTML(path, imgfile, imgfilepath):
imgfilepath = md5Checksum(imgfilepath) imgfilepath = md5Checksum(imgfilepath)
filename = getImageFileName(imgfile) filename = getImageFileName(imgfile)
if filename is not None: if filename is not None:
if "Rotated" in theGreatIndex[imgfilepath]: if options.imgproc:
rotatedPage = True if "Rotated" in theGreatIndex[imgfilepath]:
rotatedPage = True
else:
rotatedPage = False
if "NoPanelView" in theGreatIndex[imgfilepath]:
noPV = True
else:
noPV = False
if "NoHorizontalPanelView" in theGreatIndex[imgfilepath]:
noHorizontalPV = True
else:
noHorizontalPV = False
if "NoVerticalPanelView" in theGreatIndex[imgfilepath]:
noVerticalPV = True
else:
noVerticalPV = False
else: else:
rotatedPage = False rotatedPage = False
if "NoPanelView" in theGreatIndex[imgfilepath]:
noPV = True
else:
noPV = False noPV = False
if "NoHorizontalPanelView" in theGreatIndex[imgfilepath]:
noHorizontalPV = True
else:
noHorizontalPV = False noHorizontalPV = False
if "NoVerticalPanelView" in theGreatIndex[imgfilepath]:
noVerticalPV = True
else:
noVerticalPV = False noVerticalPV = False
htmlpath = '' htmlpath = ''
postfix = '' postfix = ''
@@ -163,30 +169,31 @@ def buildHTML(path, imgfile, imgfilepath):
def checkMargins(path): def checkMargins(path):
for flag in theGreatIndex[path]: if options.imgproc:
if "Margins-" in flag: for flag in theGreatIndex[path]:
flag = flag.split('-') if "Margins-" in flag:
xl = flag[1] flag = flag.split('-')
yu = flag[2] xl = flag[1]
xr = flag[3] yu = flag[2]
yd = flag[4] xr = flag[3]
if xl != "0": yd = flag[4]
xl = "-" + str(float(xl)/100) + "%" if xl != "0":
else: xl = "-" + str(float(xl)/100) + "%"
xl = "0%" else:
if xr != "0": xl = "0%"
xr = "-" + str(float(xr)/100) + "%" if xr != "0":
else: xr = "-" + str(float(xr)/100) + "%"
xr = "0%" else:
if yu != "0": xr = "0%"
yu = "-" + str(float(yu)/100) + "%" if yu != "0":
else: yu = "-" + str(float(yu)/100) + "%"
yu = "0%" else:
if yd != "0": yu = "0%"
yd = "-" + str(float(yd)/100) + "%" if yd != "0":
else: yd = "-" + str(float(yd)/100) + "%"
yd = "0%" else:
return xl, yu, xr, yd yd = "0%"
return xl, yu, xr, yd
return '0%', '0%', '0%', '0%' return '0%', '0%', '0%', '0%'