View Single Post
Old 04-10-2023, 08:44 PM   #1719
Ertagon
Junior Member
Ertagon began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Dec 2022
Device: Kindle Scribe
Quote:
Originally Posted by tomsem View Post
I took a look at the KCC (command line) code a few months ago, as it was the closest thing to my use case (make photo albums from a set of images, with landscape spreads that join smoothly when in 2 page mode on a tablet, and scaling up and down for 'best fit').

I had some success hacking to get it to do this, but reached a point where I was struggling too much with the way the code is structured, and concluded it would be better to start over from scratch.

The KCC IMO is not well structured, it seems to do too many things to do any of them well, and the greatest Python sin of all, it doesn't conform to Python naming conventions or PEP8 generally.

I think one of the KCC developers had a project to create a calibre plugin, but they wanted to use Python 3 features which wasn't supported at the time so it probably isn't much of a starting point.

So I would agree it's better to start over with a clear list of requirements, as I plan to do with my photo album idea, should I ever get around to it.

If you don't find a willing recruit, you could just build a command line tool, get that working, and worry about the plugin stuff later. Which is my plan.
I started my own development.
I am still figuring out how to access various info from the conversion panel.
Calibre does not have the most comprehensive documentation out there.
Though ChatGPT was surprisingly helpful.
I successfully overwrote most of the functions that handle CBZ as input.
Right now I am trying to figure out the right XML format for Kindle devices.
I looked at KCC but there seems to be a lot of extra code just for individual panels.
I looked at the XML used in manga bought on Amazon and it seems those extra panels are required even if they are empty.

I had to replace my Scribe and that took me some time so I had to put development on hold since I couldn't test things properly. Might give it another shot sometime soon.

Your idea of just doing CLI sounds half decent but then you can't really take advantage of lots of built-in functions of calibre conversion. I think letting Calibre handle image manipulation and just figuring out the XML format is the best approach for a calibre plugin. Though I am very new to this environment so I might be mistaken.
Ertagon is offline   Reply With Quote