Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

supporting Kindle Previewer #463

Closed
darodi opened this issue Jan 22, 2023 · 5 comments · Fixed by #466
Closed

supporting Kindle Previewer #463

darodi opened this issue Jan 22, 2023 · 5 comments · Fixed by #466
Assignees
Labels
documentation Improvements or additions to documentation Enhancement New feature or request
Milestone

Comments

@darodi
Copy link
Collaborator

darodi commented Jan 22, 2023

Kindlegen is gone. You should definitely consider supporting Kindle Previewer.

Originally posted by @Grauen in #371 (comment)

TODO: adapt README

@darodi
Copy link
Collaborator Author

darodi commented Jan 22, 2023

It can be found in "Amazon Kindle Previewer 3 Folder\lib\fc\bin" too but using the Wayback Machine is the fastest way to get it since no installation is needed.

Originally posted by @HermesPasser in #371 (comment)

@darodi darodi self-assigned this Jan 22, 2023
@darodi darodi added the Enhancement New feature or request label Jan 22, 2023
@darodi darodi modified the milestones: 6.0, 5.6.2 Jan 22, 2023
@darodi darodi added github_actions Pull requests that update GitHub Actions code documentation Improvements or additions to documentation and removed github_actions Pull requests that update GitHub Actions code labels Jan 22, 2023
This was referenced Jan 22, 2023
@innocenat
Copy link

Sorry for commenting on closed issue, but I was wondering why isn't Kindle Previewer's Kindle gen detected automatically?

It seems trivial to just add those path to kcc.py to just detect them automatically. Specifically, %LOCALAPPDATA\Amazon\Kindle Previewer 3\lib\fc\bin\ on Windows and /Applications/Kindle Previewer 3.app/Contents/lib/fc/bin/ on Mac OS. Are there anything I missed here?

@darodi
Copy link
Collaborator Author

darodi commented Mar 2, 2023

@innocenat

Right now, KCC detects kindlegen if the directory is in the PATH Environment Variable (Windows, Linux, Mac OS).
It also works if kindlegen is in the same directory as KCC.
I could add the default directory, but one can change the installation directory and path is more flexible.

A better support would be to use Kindle Previewer 3.exe directly instead of kindlegen, like here:
#460 (comment)
and a way to make it work on Linux. This work is in progress

@innocenat
Copy link

innocenat commented Mar 2, 2023

Right now, KCC detects kindlegen if the directory is in the PATH Environment Variable (Windows, Linux, Mac OS).

It actually doesn't respect PATH on Mac OS. I know, I spent hours figuring this out when I first use it. The culprit is here:

kcc/kcc.py

Lines 30 to 32 in c3dad08

os.environ['PATH'] = os.path.dirname(os.path.abspath(sys.executable)) + \
'/../Resources:/Applications/Kindle Comic Creator/Kindle Comic Creator.app/Contents/' \
'MacOS:/usr/local/bin:/usr/bin:/bin'

Basically if it's frozen (packaged) then KCC overwrite the entire PATH variable on Mac OS. On line 40, it also change the PATH variable for non-frozen path (probably to aid development).

Which is why I suggest adding the default Kindlegen path should be trivial. Note that this only apply to the GUI app, since the command line tools doesn't get invoked via kcc.py.

Also I don't think invoking Kindle Previewer directly is a good idea. Right now it produce MOBI, yes, but there are no guaranteed that one day it might produce KFX instead.

@darodi
Copy link
Collaborator Author

darodi commented Mar 2, 2023

OK I'm adding this and reopening the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation Enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants