1
0
mirror of https://github.com/ciromattia/kcc synced 2026-06-10 00:20:33 +00:00

Compare commits

..

4 Commits

Author SHA1 Message Date
Alex Xu 5e68ce380c double webtoon max height 2026-05-31 18:42:31 -07:00
Alex Xu b95cf6e179 ignore exceptions when epub parsing (#1360)
* ignore exceptions when epub parsing

* Update comic2ebook.py

* Update comic2ebook.py
2026-05-26 09:13:22 -07:00
フィルターペーパー 08070cdd97 Fix fusion output location (#1355)
* Fix fusion output location

Use source folder when output folder is not specified

* undelete things
2026-05-25 16:41:36 -07:00
Alex Xu df3d174437 fusion temp file cleanup improvements (#1359) 2026-05-25 14:52:08 -07:00
7 changed files with 22 additions and 29 deletions
+3 -7
View File
@@ -393,7 +393,10 @@ class WorkerThread(QThread):
for job in currentJobs:
bookDir.append(job)
try:
fusion_source_parent = str(Path(bookDir[0]).parent)
comic2ebook.options = comic2ebook.checkOptions(copy(options))
if options.output is None:
options.output = fusion_source_parent
currentJobs.clear()
currentJobs.append(comic2ebook.makeFusion(bookDir))
MW.addMessage.emit('Created fusion at ' + currentJobs[0], 'info', False)
@@ -557,13 +560,6 @@ class WorkerThread(QThread):
move(item, GUI.targetDirectory)
except Exception:
pass
if options.filefusion:
for path in currentJobs:
if os.path.isfile(path):
os.remove(path)
elif os.path.isdir(path):
rmtree(path, True)
comic2ebook.checkPre('LLL-')
GUI.progress.content = ''
GUI.progress.stop()
MW.hideProgressBar.emit()
+14 -17
View File
@@ -76,23 +76,19 @@ def main(argv=None):
print('No matching files found.')
return 1
if options.filefusion:
fusion_source_parent = str(Path(sources[0]).parent)
fusion_path = makeFusion(list(sources))
sources.clear()
sources.append(fusion_path)
for source in sources:
source = source.rstrip('\\').rstrip('/')
options = copy(args)
if options.filefusion and options.output is None:
options.output = fusion_source_parent
options = checkOptions(options)
print('Working on ' + source + '...')
makeBook(source)
if options.filefusion:
for path in sources:
if os.path.isfile(path):
os.remove(path)
elif os.path.isdir(path):
rmtree(path, True)
checkPre('LLL-')
return 0
@@ -979,10 +975,11 @@ def getWorkFolder(afile, workdir=None):
manifest_dict[manifest_item.attrib.get('id')] = manifest_item.attrib.get('href')
ordered_image_paths = []
for i, spine_item in enumerate(spine):
if spine_item not in manifest_dict:
try:
page_path = os.path.join(os.path.dirname(opf_path), manifest_dict[spine_item])
page = ET.parse(page_path)
except Exception:
continue
page_path = os.path.join(os.path.dirname(opf_path), manifest_dict[spine_item])
page = ET.parse(page_path)
imgs = page.findall(r'.//{*}img') + page.findall(r'.//{*}image')
largest_size = 0
@@ -1690,8 +1687,8 @@ def makeFusion(sources: List[str]):
raise UserWarning('Fusion requires at least 2 sources. Did you forget to uncheck fusion?')
start = perf_counter()
first_path = Path(sources[0])
if True:
if options.tempdir:
fusion_parent = first_path.parent
else:
# LLL is after KCC
@@ -1899,11 +1896,11 @@ def makeBook(source, qtgui=None, job_progress=''):
end = perf_counter()
print(f"{job_progress}makeBook: {end - start} seconds")
# Clean up temporary workspace
try:
rmtree(path, True)
except Exception:
pass
if options.filefusion:
rmtree(source, True)
checkPre('LLL-')
return filepath
+1 -1
View File
@@ -62,7 +62,7 @@ def mergeDirectory(work):
imagesValid.append(i[0])
# Silently drop directories that contain too many images
# 131072 = GIMP_MAX_IMAGE_SIZE / 4
if targetHeight > 131072 * 4:
if targetHeight > 131072 * 8:
raise RuntimeError(f'Image too tall at {targetHeight} pixels. {targetWidth} pixels wide. Try using separate chapter folders or file fusion.')
result = Image.new('RGB', (targetWidth, targetHeight))
y = 0
+1 -1
View File
@@ -1,5 +1,5 @@
Pillow>=11.3.0
psutil>=7.2.2
psutil>=5.9.5
requests>=2.34.2
python-slugify>=8.0.4
packaging>=26.2
+1 -1
View File
@@ -1,6 +1,6 @@
PySide6==6.4.3
Pillow>=11.3.0
psutil>=7.2.2
psutil>=5.9.5
requests>=2.34.2
python-slugify>=8.0.4
packaging>=26.2
+1 -1
View File
@@ -1,6 +1,6 @@
PySide6==6.1.3
Pillow>=9
psutil>=7.2.2
psutil>=5.9.5
requests>=2.32.4
python-slugify>=8.0.4
packaging>=26.2
+1 -1
View File
@@ -1,6 +1,6 @@
PySide6<6.10
Pillow>=11.3.0
psutil>=7.2.2
psutil>=5.9.5
requests>=2.34.2
python-slugify>=8.0.4,<9.0.0
packaging>=26.2