mirror of
https://github.com/ciromattia/kcc
synced 2025-12-15 10:46:40 +00:00
fix landscape alignment (#865)
This commit is contained in:
@@ -358,19 +358,19 @@ def buildOPF(dstdir, title, filelist, cover=None):
|
|||||||
pageside = "right"
|
pageside = "right"
|
||||||
for entry in reflist:
|
for entry in reflist:
|
||||||
if options.righttoleft:
|
if options.righttoleft:
|
||||||
if entry.endswith("-a"):
|
if entry.endswith("-kcc-a"):
|
||||||
f.write(
|
f.write(
|
||||||
"<itemref idref=\"page_%s\" %s/>\n" % (entry,
|
"<itemref idref=\"page_%s\" %s/>\n" % (entry,
|
||||||
pageSpreadProperty("center"))
|
pageSpreadProperty("center"))
|
||||||
)
|
)
|
||||||
pageside = "right"
|
pageside = "right"
|
||||||
elif entry.endswith("-b"):
|
elif entry.endswith("-kcc-b"):
|
||||||
f.write(
|
f.write(
|
||||||
"<itemref idref=\"page_%s\" %s/>\n" % (entry,
|
"<itemref idref=\"page_%s\" %s/>\n" % (entry,
|
||||||
pageSpreadProperty("right"))
|
pageSpreadProperty("right"))
|
||||||
)
|
)
|
||||||
pageside = "right"
|
pageside = "right"
|
||||||
elif entry.endswith("-c"):
|
elif entry.endswith("-kcc-c"):
|
||||||
f.write(
|
f.write(
|
||||||
"<itemref idref=\"page_%s\" %s/>\n" % (entry,
|
"<itemref idref=\"page_%s\" %s/>\n" % (entry,
|
||||||
pageSpreadProperty("left"))
|
pageSpreadProperty("left"))
|
||||||
@@ -386,19 +386,19 @@ def buildOPF(dstdir, title, filelist, cover=None):
|
|||||||
else:
|
else:
|
||||||
pageside = "right"
|
pageside = "right"
|
||||||
else:
|
else:
|
||||||
if entry.endswith("-a"):
|
if entry.endswith("-kcc-a"):
|
||||||
f.write(
|
f.write(
|
||||||
"<itemref idref=\"page_%s\" %s/>\n" % (entry,
|
"<itemref idref=\"page_%s\" %s/>\n" % (entry,
|
||||||
pageSpreadProperty("center"))
|
pageSpreadProperty("center"))
|
||||||
)
|
)
|
||||||
pageside = "left"
|
pageside = "left"
|
||||||
elif entry.endswith("-b"):
|
elif entry.endswith("-kcc-b"):
|
||||||
f.write(
|
f.write(
|
||||||
"<itemref idref=\"page_%s\" %s/>\n" % (entry,
|
"<itemref idref=\"page_%s\" %s/>\n" % (entry,
|
||||||
pageSpreadProperty("left"))
|
pageSpreadProperty("left"))
|
||||||
)
|
)
|
||||||
pageside = "left"
|
pageside = "left"
|
||||||
elif entry.endswith("-c"):
|
elif entry.endswith("-kcc-c"):
|
||||||
f.write(
|
f.write(
|
||||||
"<itemref idref=\"page_%s\" %s/>\n" % (entry,
|
"<itemref idref=\"page_%s\" %s/>\n" % (entry,
|
||||||
pageSpreadProperty("right"))
|
pageSpreadProperty("right"))
|
||||||
@@ -544,7 +544,7 @@ def buildEPUB(path, chapternames, tomenumber, ischunked):
|
|||||||
global_diff = 0
|
global_diff = 0
|
||||||
|
|
||||||
for x in range(0, pageid + cur_diff + 1):
|
for x in range(0, pageid + cur_diff + 1):
|
||||||
if '-KCC-B' in filelist[x][1]:
|
if '-kcc-b' in filelist[x][1]:
|
||||||
pageid += diff_delta
|
pageid += diff_delta
|
||||||
global_diff += diff_delta
|
global_diff += diff_delta
|
||||||
|
|
||||||
|
|||||||
@@ -285,14 +285,14 @@ class ComicPage:
|
|||||||
self.rotated = False
|
self.rotated = False
|
||||||
self.orgPath = os.path.join(path[0], path[1])
|
self.orgPath = os.path.join(path[0], path[1])
|
||||||
if 'N' in mode:
|
if 'N' in mode:
|
||||||
self.targetPath = os.path.join(path[0], os.path.splitext(path[1])[0]) + '-KCC'
|
self.targetPath = os.path.join(path[0], os.path.splitext(path[1])[0]) + '-kcc'
|
||||||
elif 'R' in mode:
|
elif 'R' in mode:
|
||||||
self.targetPath = os.path.join(path[0], os.path.splitext(path[1])[0]) + '-KCC-A'
|
self.targetPath = os.path.join(path[0], os.path.splitext(path[1])[0]) + '-kcc-a'
|
||||||
self.rotated = True
|
self.rotated = True
|
||||||
elif 'S1' in mode:
|
elif 'S1' in mode:
|
||||||
self.targetPath = os.path.join(path[0], os.path.splitext(path[1])[0]) + '-KCC-B'
|
self.targetPath = os.path.join(path[0], os.path.splitext(path[1])[0]) + '-kcc-b'
|
||||||
elif 'S2' in mode:
|
elif 'S2' in mode:
|
||||||
self.targetPath = os.path.join(path[0], os.path.splitext(path[1])[0]) + '-KCC-C'
|
self.targetPath = os.path.join(path[0], os.path.splitext(path[1])[0]) + '-kcc-c'
|
||||||
# backwards compatibility for Pillow >9.1.0
|
# backwards compatibility for Pillow >9.1.0
|
||||||
if not hasattr(Image, 'Resampling'):
|
if not hasattr(Image, 'Resampling'):
|
||||||
Image.Resampling = Image
|
Image.Resampling = Image
|
||||||
|
|||||||
Reference in New Issue
Block a user