1
0
mirror of https://github.com/ciromattia/kcc synced 2025-12-13 01:36:27 +00:00
Commit Graph

198 Commits

Author SHA1 Message Date
Adrian
1fa5a5b19b Improved color detection (#1003)
* Improved color detection

* use pure python

---------

Co-authored-by: Alex Xu <alexkurosakimh3@gmail.com>
2025-06-30 17:18:04 -07:00
Alex Xu
6299c45790 fix flatpak kindlegen detection (7.5.0 regression) (#1000)
* fix flatpak kindlegen detection

* fix shared
2025-06-29 09:28:47 -07:00
Adrian
217a18b7b5 Save images in GIF when output is set to MOBI and forcepng is used (#981)
* Save images in GIF when output is set to MOBI and forcepng option is used

* Save images in GIF when output is set to EPUB, kindle profile is used and forcepng option is set

* media-type="image/gif"

---------

Co-authored-by: Alex Xu <alexkurosakimh3@gmail.com>
2025-06-24 22:14:00 -07:00
Alex Xu
32020d6b07 display-block (#986) 2025-06-20 17:28:42 -07:00
Adrian
221f964f14 Improve code readability (#984) 2025-06-20 10:12:24 -07:00
Adrian
e9f0310b94 Fixes to grayscale pages in forcecolor mode (#978)
* Fix bit depth of non-color pages in forcecolor mode

* Optimization for JPEG non-color pages in forcecolor mode
2025-06-18 15:12:12 -07:00
Alex Xu
623bce6ae3 fix scribe skinny images (#972) 2025-06-17 11:29:27 -07:00
Alex Xu
f1db31205b split then rotate (#966) 2025-06-16 14:47:55 -07:00
jorge-castellon-jr
eef5a85fa6 ComicInfo.xml Title checkbox (#944)
* Adds options to use metadata title as output name

* update .ui files

* write rest

* small fixes

* small fix

* fix small

---------

Co-authored-by: Alex Xu <alexkurosakimh3@gmail.com>
2025-06-16 11:58:26 -07:00
Alex Xu
271200d29f fix scribe order 2025-06-16 10:50:52 -07:00
Silver0006
ee375abfc5 Added ability to combine multiple CBZ into one files (#960)
* Added basic CBZ combine func

Need to add support for epub and maybe mobi.

* Removed irrelevant code for CBZ file fusion

* Fixed false description

* Removed irrelevant code

* Removed redundant code

Replaced page tracker and os.rename with os.renames. Removed unneeded reference to gui. Changed mkdir to mkdtemp.

* Made folder and cbz work together

You can select multiple folders of images, multiple cbz files, and folders with subfolders. Fusion will combine them all together at the same time. Mainly added this to idiot proof it.

* Updated gui

Removed redundant tooltip

* simplify code

* fix merging chapter folders with .

* uncheck fusion message

---------

Co-authored-by: Alex Xu <alexkurosakimh3@gmail.com>
2025-06-15 14:58:03 -07:00
Alex Xu
a05111b64a Scribe 2480 support (#962)
* add imgfile2

* add 2480

* use older mozjpeg

* fix above below

* fix imgsize2

* fix newline

* rename targetPath

* fix cover.jpg

* fix opf

* fix above

* fix splitting
2025-06-13 16:45:27 -07:00
Alex Xu
eb0abb538c add tome text for splits (#963) 2025-06-13 12:22:07 -07:00
Alex Xu
ae7f56c81b ignore kindlegen warnings (#961) 2025-06-11 16:01:25 -07:00
Alex Xu
4bb6ba55d3 cover has minimal processing and is shared across splits (#953)
* refactor cover handling

* skip cover processing

* rename cover to cover_path

* fix scribe mobi detection

* make things closer

* rename save to save_to_epub
2025-06-08 11:08:57 -07:00
orpheus1120
c7e69f5bdb Do not slugify folder names when output format is CBZ (fixes #914) (#920) 2025-06-04 13:38:17 -07:00
Alex Xu
34bea98ca0 align preceding pages around pre-joined spreads in landscape (#942)
* refactor spread properties

* fix spread alighment backwards

* more consistent quotes
2025-05-30 10:33:19 -07:00
Alex Xu
d4d71cdd05 restore 2 panel view option (#940)
* Revert "disable old panel view for new kindles"

This reverts commit c4bab13a3e.

* fix HQ panel view warnings

* restore half page portrait panel view

* fix imports

* remove unneeded
2025-05-26 17:40:37 -07:00
Alex Xu
c4f845c221 dot_clean 2025-05-25 17:24:03 -07:00
Alex Xu
ebb59dbc2d make error message more clear for covers (#938)
* add error reporting to cover

* fix period
2025-05-25 17:02:14 -07:00
Alex Xu
8da2b4cb96 ignore ._ files for real 2025-05-25 13:30:04 -07:00
Alex Xu
7b8858678f ignore utf-8 decoding errors 2025-05-25 13:30:04 -07:00
Alex Xu
be07e0df6a add error check for filepath length check 2025-05-23 10:48:31 -07:00
Alex Xu
dc711e671d unescape ampersand (&) (#923) 2025-05-22 18:04:40 -07:00
Alex Xu
581ecd0ec2 flatten subfolders if over windows MAX_LENGTH=260 characters (#922) 2025-05-22 18:04:21 -07:00
Alex Xu
559485184d refactor kindlegen errors 2025-05-11 15:11:56 -07:00
Alex Xu
75f5274449 throw kindlegen exceptions 2025-05-11 15:11:56 -07:00
Alex Xu
08acad10ea enable/disable panel view in Kindle Aa menu and landscape half page reading (#899)
* enable virtual panel view for all kindles

* only use old panel view method on older Kindles
2025-04-17 08:17:57 -07:00
Alex Xu
13e71df172 remove nested empty folders (#900) 2025-04-16 23:07:41 -07:00
Alex Xu
3e3710dd76 Add preserve margin % toggle (#886)
* preserve margin

* set ratio to 0.5

* add preserve margin GUI

* increase step size to 5

* remove clear

* fix save

* save preserveMarginBox

* math

* max 99
2025-04-03 10:11:14 -07:00
Alex Xu
41f87273ca speed optimization: fix accidentally cropping pages twice (#889)
* don't crop each page twice

* Update comic2ebook.py
2025-03-30 08:58:35 -07:00
Alex Xu
ef3b756247 fix unsupported directory structure and large mobi conversion stuck with nested folders by flattening folders (#869) 2025-03-15 08:09:17 -07:00
simesherbs
6a33aee241 New "MOBI + EPUB (200MB)" output option (#866)
* initial fix

* initial

* working, but mobi is a bit too large

* changed target size to 190mb to account for mobi conversion size increase

* changed target size back to 195

* removed debugging print statements

* add trailing comma

---------

Co-authored-by: Alex Xu <alexkurosakimh3@gmail.com>
2025-03-13 09:07:03 -07:00
Alex Xu
23099cee81 fix landscape alignment (#865) 2025-03-12 19:09:58 -07:00
Alex Xu
9992d895cf fix comicrack large files again (#860) 2025-03-11 15:07:48 -07:00
Alex Xu
561951a349 restore imgMetadata dict (#858)
* Revert "memory optimization: store metadata in filenames, not a global dict (…"

This reverts commit 9a2a09eab9.

* only remove imgOld
2025-03-11 09:57:11 -07:00
Alex Xu
9a2a09eab9 memory optimization: store metadata in filenames, not a global dict (#853)
* remove options.imgMetadata and store metadata in filename

* make kcc much more memory efficient by removing imgMetadata and imgOld dicts
2025-03-09 16:52:07 -07:00
Alex Xu
88cf2fd21f fix sanitize-first bug 2025-03-09 16:50:15 -07:00
Vinh Quang Tran
7a3ed262b1 fix: disabled overriding title (#857) 2025-03-09 16:22:34 -07:00
Alex Xu
9e204aad76 rename images before processing to fix splitting issues (#852)
* rename images before processing to fix splitting issues

* import pathlib

* 9999 page limit
2025-03-07 07:59:04 -08:00
Alex Xu
01625904d1 huge speed optimization on HDD by removing md5 (#845)
* Eliminate unnecessary use of MD5 checksum

md5checksum() computes the actual checksum of a specified file, which is appropriately expensive, but the code seemed to be using the checksum result as a key into the imgMetadata dictionary to avoid handling image files being renamed during processing steps. This seems like a very expensive way to handle the rename so instead, I now update the imgMetadata keys with the new filename in the one place that the rename happens, and avoid MD5 checksums entirely.

* merge conflicts

* Add missing handling for image path renames due to nested chapter folder name

* merge conflicts

* merge conflicts

* add perf_counters

* imgFileProcessing perf_counter

* use startswith and removeprefix

---------

Co-authored-by: utopiafallen <utopiafallen@gmail.com>
2025-03-04 11:28:23 -08:00
Alex Xu
5f8526da44 all image files have unique ordered names (#848) 2025-03-03 07:50:21 -08:00
Alex Xu
1159e737a0 small correction to 7z (#847) 2025-03-02 19:55:45 -08:00
Alex Xu
1a3cd6c916 add perf_counter to makeBook (#846) 2025-03-02 12:24:49 -08:00
Alex Xu
e1e6d587f4 makeZIP now prefers 7z for SPEED (#844) 2025-03-02 11:08:27 -08:00
Alex Xu
be147fe7e5 saves several seconds per file (#841) 2025-02-28 20:11:11 -08:00
utopiafallen
62ffa2bc80 Improve processing performance by partially undoing "Refactored detection of corrupted files"
Commit f952634971 moved image corruption detection out from the ComicPage constructor and into a standalone detectCorruption() function. This led to a performance regression because now corruption detection happens in a single thread when it used to be distributed across worker threads, and because a source image is now loaded twice in memory: once during corruption detection and once when actually going to process the image.

Image file corruption detection is now back inside the ComicPage constructor and the extra load() has been removed because the convert() call will automatically invoke load() and most likely throw the same exceptions.
2025-02-28 19:49:13 -08:00
Alex Xu
11186d07c0 fix file splitting/chunking for real in certain situations (#839)
* fix file splitting without ComicInfo.xml

* remove dead var
2025-02-28 19:19:11 -08:00
Alex Xu
11a395e983 fix pdf workdir (#830) 2025-02-20 18:24:06 -08:00
Alex Xu
2e39a8c227 add jpeg2000 (#828) 2025-02-19 16:29:26 -08:00