mirror of
https://github.com/ciromattia/kcc
synced 2026-09-14 23:07:09 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
74042791f6 | ||
|
|
7245fdf2e1 | ||
|
|
fe85274105 |
@@ -183,7 +183,11 @@ You'll need to install various tools to access important but optional features.
|
||||
|
||||
### KindleGen
|
||||
|
||||
On Windows and macOS, install [Kindle Previewer](https://www.amazon.com/Kindle-Previewer/b?ie=UTF8&node=21381691011) and `kindlegen` will be autodetected from it.
|
||||
On Windows and macOS, install Kindle Previewer and `kindlegen` will be autodetected from it.
|
||||
|
||||
> [!WARNING]
|
||||
> On Sept 14, 2026, Kindle Previewer was updated to version 4, which made kindlegen harder to use.
|
||||
> In the meantime, please download the older version 3: https://web.archive.org/web/20260819184257/https://kdp.amazon.com/en_US/help/topic/G202131170
|
||||
|
||||
If you have issues detecting it, get stuck on the MOBI conversion step, or use Linux AppImage or Flatpak, refer to the wiki: https://github.com/ciromattia/kcc/wiki/Installation#kindlegen
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ def modify_path():
|
||||
mac_paths = [
|
||||
'/Applications/Kindle Comic Creator/Kindle Comic Creator.app/Contents/MacOS',
|
||||
'/Applications/Kindle Previewer 3.app/Contents/lib/fc/bin/',
|
||||
'/Applications/Kindle Previewer 4.app/Contents/Resources/KFXGen/bin/'
|
||||
]
|
||||
if getattr(sys, 'frozen', False):
|
||||
os.environ['PATH'] += os.pathsep + os.pathsep.join(mac_paths +
|
||||
|
||||
@@ -418,6 +418,7 @@ class WorkerThread(QThread):
|
||||
if GUI.jobList.item(i).icon().isNull():
|
||||
currentJobs.append(str(GUI.jobList.item(i).text()))
|
||||
GUI.jobList.clear()
|
||||
fusion_cover_path = None
|
||||
if options.filefusion:
|
||||
bookDir = []
|
||||
MW.addMessage.emit('Attempting file fusion', 'info', False)
|
||||
@@ -429,7 +430,8 @@ class WorkerThread(QThread):
|
||||
if options.output is None:
|
||||
options.output = fusion_source_parent
|
||||
currentJobs.clear()
|
||||
currentJobs.append(comic2ebook.makeFusion(bookDir))
|
||||
job, fusion_cover_path = comic2ebook.makeFusion(bookDir)
|
||||
currentJobs.append(job)
|
||||
MW.addMessage.emit('Created fusion at ' + currentJobs[0], 'info', False)
|
||||
except Exception as e:
|
||||
print('Fusion Failed. ' + str(e))
|
||||
@@ -463,7 +465,7 @@ class WorkerThread(QThread):
|
||||
jobargv.append(job)
|
||||
try:
|
||||
comic2ebook.options = comic2ebook.checkOptions(copy(options))
|
||||
outputPath = comic2ebook.makeBook(job, self, job_progress_number)
|
||||
outputPath = comic2ebook.makeBook(job, fusion_cover_path, self, job_progress_number)
|
||||
MW.hideProgressBar.emit()
|
||||
except UserWarning as warn:
|
||||
if not self.conversionAlive:
|
||||
@@ -1405,7 +1407,7 @@ class KCCGUI(KCC_ui.Ui_mainWindow):
|
||||
except OSError as e:
|
||||
self.kindleGen = False
|
||||
if startup:
|
||||
error = f"kindlegen: {e.strerror}\n\n Re-install Rosetta/Kindle Previewer/other Intel app?\n\nPlease email Amazon to make Kindle Previewer Apple silicon native at amazon.com/kindle-help"
|
||||
error = f"kindlegen: {e.strerror}\n\n Re-install or re-open Rosetta/Kindle Previewer/other Intel app?"
|
||||
self.showDialog(error, 'error')
|
||||
|
||||
def __init__(self, kccapp, kccwindow):
|
||||
|
||||
@@ -77,9 +77,10 @@ def main(argv=None):
|
||||
if len(sources) == 0:
|
||||
print('No matching files found.')
|
||||
return 1
|
||||
fusion_cover_path = None
|
||||
if options.filefusion:
|
||||
fusion_source_parent = str(Path(sources[0]).parent)
|
||||
fusion_path = makeFusion(list(sources))
|
||||
fusion_path, fusion_cover_path = makeFusion(list(sources))
|
||||
sources.clear()
|
||||
sources.append(fusion_path)
|
||||
for source in sources:
|
||||
@@ -89,7 +90,7 @@ def main(argv=None):
|
||||
options.output = fusion_source_parent
|
||||
options = checkOptions(options)
|
||||
print('Working on ' + source + '...')
|
||||
makeBook(source)
|
||||
makeBook(source, fusion_cover_path)
|
||||
|
||||
return 0
|
||||
|
||||
@@ -1755,8 +1756,7 @@ def checkTools(source):
|
||||
sys.exit(1)
|
||||
except OSError as e:
|
||||
print(f"kindlegen: {e.strerror}")
|
||||
print('Re-install Rosetta/Kindle Previewer/other Intel app?')
|
||||
print('Please email Amazon to make Kindle Previewer Apple silicon native at amazon.com/kindle-help')
|
||||
print('Re-install or re-open Rosetta/Kindle Previewer/other Intel app?')
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
@@ -1773,6 +1773,19 @@ def makeFusion(sources: List[str]):
|
||||
start = perf_counter()
|
||||
first_path = Path(sources[0])
|
||||
|
||||
fusion_cover_path = None
|
||||
if first_path.parent.joinpath('Covers').is_dir():
|
||||
covers = os.listdir(first_path.parent.joinpath('Covers'))
|
||||
filtered_covers = []
|
||||
for cover in covers:
|
||||
_, cover_ext = getImageFileName(cover)
|
||||
if cover_ext in IMAGE_TYPES:
|
||||
filtered_covers.append(cover)
|
||||
try:
|
||||
fusion_cover_path = first_path.parent.joinpath('Covers', filtered_covers[0])
|
||||
except IndexError:
|
||||
pass
|
||||
|
||||
if options.tempdir:
|
||||
fusion_parent = first_path.parent
|
||||
else:
|
||||
@@ -1814,10 +1827,10 @@ def makeFusion(sources: List[str]):
|
||||
print(f"makefusion: {end - start} seconds")
|
||||
print("Combined File: "+ str(fusion_path))
|
||||
|
||||
return str(fusion_path)
|
||||
return str(fusion_path), fusion_cover_path
|
||||
|
||||
|
||||
def makeBook(source, qtgui=None, job_progress=''):
|
||||
def makeBook(source, fusion_cover_path=None, qtgui=None, job_progress=''):
|
||||
start = perf_counter()
|
||||
global GUI
|
||||
GUI = qtgui
|
||||
@@ -1912,9 +1925,12 @@ def makeBook(source, qtgui=None, job_progress=''):
|
||||
options.customcover = True
|
||||
except IndexError:
|
||||
pass
|
||||
if fusion_cover_path:
|
||||
options.customcover = True
|
||||
cover_path = fusion_cover_path
|
||||
|
||||
cover = None
|
||||
if not options.webtoon:
|
||||
if not options.webtoon or options.customcover:
|
||||
cover = image.Cover(cover_path, options)
|
||||
|
||||
x, y = image.ProfileData.Profiles[options.profile][1]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Pillow>=11.3.0
|
||||
psutil>=7.2.2
|
||||
requests>=2.34.2
|
||||
python-slugify>=9.0.0
|
||||
python-slugify>=8.0.4
|
||||
packaging>=26.2
|
||||
mozjpeg-lossless-optimization>=1.2.0
|
||||
natsort>=8.4.0
|
||||
|
||||
@@ -2,7 +2,7 @@ PySide6==6.4.3
|
||||
Pillow>=11.3.0
|
||||
psutil>=7.2.2
|
||||
requests>=2.34.2
|
||||
python-slugify>=9.0.0
|
||||
python-slugify>=8.0.4
|
||||
packaging>=26.2
|
||||
mozjpeg-lossless-optimization>=1.2.0
|
||||
natsort>=8.4.0
|
||||
|
||||
@@ -2,7 +2,7 @@ PySide6==6.1.3
|
||||
Pillow>=9
|
||||
psutil>=7.2.2
|
||||
requests>=2.32.4
|
||||
python-slugify>=9.0.0
|
||||
python-slugify>=8.0.4
|
||||
packaging>=26.2
|
||||
mozjpeg-lossless-optimization>=1.2.0
|
||||
natsort>=8.4.0
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ PySide6<6.10
|
||||
Pillow>=11.3.0
|
||||
psutil>=7.2.2
|
||||
requests>=2.34.2
|
||||
python-slugify>=9.0.0,<10.0.0
|
||||
python-slugify>=8.0.4,<9.0.0
|
||||
packaging>=26.2
|
||||
mozjpeg-lossless-optimization>=1.2.0
|
||||
natsort>=8.4.0
|
||||
|
||||
Reference in New Issue
Block a user