mirror of
https://github.com/ciromattia/kcc
synced 2026-01-30 00:47:37 +00:00
Made split filenames more idiot-proof
This commit is contained in:
@@ -256,7 +256,7 @@ def buildOPF(profile, dstdir, title, filelist, cover=None):
|
||||
f.write("</manifest>\n<spine toc=\"ncx\">\n")
|
||||
splitCountUsed = 1
|
||||
for entry in reflist:
|
||||
if entry.endswith("-000001") or entry.endswith("-1"):
|
||||
if entry.endswith("-kcca"):
|
||||
# noinspection PyRedundantParentheses
|
||||
if ((options.righttoleft and facing == 'left') or (not options.righttoleft and facing == 'right')) and\
|
||||
options.landscapemode:
|
||||
@@ -266,7 +266,7 @@ def buildOPF(profile, dstdir, title, filelist, cover=None):
|
||||
f.write("<itemref idref=\"page_" + entry + "\" properties=\"page-spread-" + facing1 + "\"/>\n")
|
||||
else:
|
||||
f.write("<itemref idref=\"page_" + entry + "\"/>\n")
|
||||
elif entry.endswith("-000002") or entry.endswith("-2"):
|
||||
elif entry.endswith("-kccb"):
|
||||
if options.landscapemode:
|
||||
f.write("<itemref idref=\"page_" + entry + "\" properties=\"page-spread-" + facing2 + "\"/>\n")
|
||||
else:
|
||||
|
||||
@@ -218,8 +218,8 @@ class ComicPage:
|
||||
leftbox = (0, 0, width, height / 2)
|
||||
rightbox = (0, height / 2, width, height)
|
||||
filename = os.path.splitext(os.path.basename(self.origFileName))
|
||||
fileone = targetdir + '/' + filename[0] + '-1' + filename[1]
|
||||
filetwo = targetdir + '/' + filename[0] + '-2' + filename[1]
|
||||
fileone = targetdir + '/' + filename[0] + '-kcca' + filename[1]
|
||||
filetwo = targetdir + '/' + filename[0] + '-kccb' + filename[1]
|
||||
try:
|
||||
if righttoleft:
|
||||
pageone = self.image.crop(rightbox)
|
||||
|
||||
Reference in New Issue
Block a user