MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Plugins (https://www.mobileread.com/forums/forumdisplay.php?f=268)
-   -   kindlegen plugin for Sigil (https://www.mobileread.com/forums/showthread.php?t=248629)

Doitsu 06-09-2017 03:03 AM

Quote:

Originally Posted by AlanHK (Post 3534384)
I'm using Sigil 0.91.

BTW, the current version is Sigil 0.9.8. If you update to that version the error message will go away.

I attached an updated version that should work with older versions to the first post.

Quote:

Originally Posted by AlanHK (Post 3534384)
I didn't see the preferences GUI. How do I get that?

It'll be automatically displayed.

Quote:

Originally Posted by AlanHK (Post 3534384)
Also there is no kindlegen.ini file anywhere. The old one was deleted when I uninstalled it, but no new one was created.

The current version no longer uses a kindlegen.ini file.

AlanHK 06-09-2017 06:04 AM

Quote:

Originally Posted by Doitsu (Post 3534403)
BTW, the current version is Sigil 0.9.8. If you update to that version the error message will go away.

Can't do that unless DiapDealer updates his XP build. Or I upgrade my Windows.

Quote:

Originally Posted by Doitsu (Post 3534403)
I attached an updated version that should work with older versions to the first post.
It'll be automatically displayed.

Yes! It works. Thanks.

However, it gave me this non-fatal error:
Quote:

can't invoke "winfo" command: application has been destroyed
while executing
"winfo exists $w"
(procedure "ttk::entry::AutoScroll" line 3)
invoked from within
"ttk::entry::AutoScroll .41717104.41749392"
(in namespace inscope "::" script line 1)
invoked from within
"::namespace inscope :: {ttk::entry::AutoScroll .41717104.41749392}"
("uplevel" body line 1)
invoked from within
"uplevel #0 $Repeat(script)"
(procedure "ttk::Repeat" line 3)
invoked from within
"ttk::Repeat"
("after" script)
But after clicking "go ahead anyway" it did complete.


Quote:

Originally Posted by Doitsu (Post 3534403)
The current version no longer uses a kindlegen.ini file.

Where does it keep its settings now?

I did a conversion and ticked the "thumbnail" option.
That made a file "thumbnail_EBOK_portrait.jpg"
which would be rather useless, since there is no link to the book.
So I tried adding the fake ASIN, then that made the files:

Obsidian_&_Blood_d9ddc69e3e95.azw3
thumbnail_d9ddc69e3e95_EBOK_portrait.jpg

Presumably the fake ASIN d9ddc69e3e95 is written into the azw3.

Perhaps these options should be linked in the settings.

Also, I received the warning
Quote:

Warning: The cover is too small: 396 x 600
I ignored that since I thought it looked fine at full screen and this is not anything I'm going to distribute.

But while the thumbnail was 217x330, in the Kindle's (PW-3, 5.8.9.2) grid display the thumbnail was 2/3 the size of others (which I had loaded using Calibre, but had 600x800 or larger cover images).

Do you know how the grid display size is determined?
I can resize the cover in the ePub but would prefer it if the thumbnail in the grid filled its slot.

JSWolf 06-09-2017 08:33 AM

If your hardware supports it, upgrading your Windows is the best thing you can do.

DiapDealer 06-09-2017 09:48 AM

Quote:

Originally Posted by AlanHK (Post 3534452)
Can't do that unless DiapDealer updates his XP build.

I'd like to take a stab at that some day when I have more time. I don't like abandoning older systems if it can be avoided. A new, unofficial legacy build of v0.9.8 wouldn't be a herculean task by any means, but it would involve some work, and I can't guarantee it wouldn't have issues. Vista is very much "on the bubble" of joining XP in Legacy Land by the way (RE Sigil). Just know that these OSes are not being abandoned by Sigil simply because Microsoft has announced End of Support for them.

Look for a Sigil legacy thread for further development on that front. I don't want to hijack/derail Doitsu's plugin thread too badly, afterall. ;)

Doitsu 06-09-2017 10:14 AM

1 Attachment(s)
Quote:

Originally Posted by AlanHK (Post 3534452)
However, it gave me this non-fatal error:

I'll look into this, but I'm not overly optimistic that I'll be able to fix it, because I don't have access to Windows XP machines.
I've attached a slightly modified version that might fix this issue.

Quote:

Originally Posted by AlanHK (Post 3534452)
Where does it keep its settings now?

They're stored in ...\sigil\plugins_prefs\KindleGen\KindleGen.json. However, you won't need to edit this file since the plugin will automatically update it whenver you change plugin settings.

Quote:

Originally Posted by AlanHK (Post 3534452)
So I tried adding the fake ASIN, then that made the files:
Obsidian_&_Blood_d9ddc69e3e95.azw3
thumbnail_d9ddc69e3e95_EBOK_portrait.jpg
Presumably the fake ASIN d9ddc69e3e95 is written into the azw3.

The thumbnail file always has the same fake ASIN number as the azw3 file. (Without an ASIN number the cover won't be displayed.)
BTW, you'll need to manually copy the cover image to the \system\thumbnails folder on the Kindle.

Quote:

Originally Posted by AlanHK (Post 3534452)
Also, I received the warning
Code:

Warning: The cover is too small: 396 x 600

You can ignore this warning if you don't intend to publish books via Amazon KDP.

Quote:

Originally Posted by AlanHK (Post 3534452)
Do you know how the grid display size is determined?

AFAIK, it depends on the screen resolution of the Kindle model. If you're not happy with the result, open plugin.py and change the following values:

Code:

              img.thumbnail((330, 330), Image.ANTIALIAS)
BTW, this plugin is primarily intended for ebook designers who upload books to Amazon KDP. Pretty much all other users are better off using Calibre instead.

AlanHK 06-09-2017 03:53 PM

Quote:

Originally Posted by Doitsu (Post 3534581)
I'll look into this, but I'm not overly optimistic that I'll be able to fix it, because I don't have access to Windows XP machines.
I've attached a slightly modified version that might fix this issue.

Yep, it does. Thanks


Quote:

Originally Posted by Doitsu (Post 3534581)
The thumbnail file always has the same fake ASIN number as the azw3 file. (Without an ASIN number the cover won't be displayed.)
BTW, you'll need to manually copy the cover image to the \system\thumbnails folder on the Kindle.

I know that. I was wondering how the ASIN was in the AZW file, so I unpacked it and found it in the OPF.
Can I put an ASIN in the epub OPF to set my own (fake or maybe real) ASIN?


Quote:

Originally Posted by Doitsu (Post 3534581)
AFAIK, it depends on the screen resolution of the Kindle model. If you're not happy with the result, open plugin.py and change the following values:

Code:

img.thumbnail((330, 330), Image.ANTIALIAS)

Can you advise what these numbers mean? The size? But the thumbnails aren't square. The blank slots (for books with no thumb) are 1"x1.5" on my screen. Maybe this was written for PW1 & 2, with 220ppi. I have a PW3, 300 ppi, so that's 300x450 pixels.


I tried enlarging the thumb to 600x800 (externally) and loading it in the thumbnail folder. It just displayed at 1" =300 px wide. So it seems it reduces to fit, but not expands.


Quote:

Originally Posted by Doitsu (Post 3534581)
BTW, this plugin is primarily intended for ebook designers who upload books to Amazon KDP. Pretty much all other users are better off using Calibre instead.

I do design ebooks, for some years, but just got an actual Kindle last week after using an emulator until now.

Anyway, I hate the way Calibre copies and renames all my books. Makes it a real pain to use if I'm editing them in Sigil to make adjustments. Much prefer to do it all in Sigil.

Doitsu 06-09-2017 05:00 PM

Quote:

Originally Posted by AlanHK (Post 3534772)
I kjnow that. I was wondering how the ASIN was in the AZW file, so I unpacked it and found it in the OPF.
Can I put an ASIN in the epub OPF to set my own (fake or maybe real) ASIN?

You can define your own ASIN number using one of the two following metadata entry formats:

Code:

<dc:identifier opf:scheme="MOBI-ASIN">XXXXXXXXXX</dc:identifier>
<dc:identifier opf:scheme="AMAZON">XXXXXXXXXX</dc:identifier>

Quote:

Originally Posted by AlanHK (Post 3534772)
Can you advise what these numbers mean? The size? But the thumbnails aren't square.

Unfortunately, I can't help you with that, I believe that I arrived at these values after some trial and error with my PW2. IIRC, both values need to be identical to maintain the aspect ratio.

BTW, if you also have a modern PC, you might want to give jhowell's Calibre KFX plugin a try.

AlanHK 06-10-2017 02:32 AM

Quote:

Originally Posted by Doitsu (Post 3534820)
Unfortunately, I can't help you with that, I believe that I arrived at these values after some trial and error with my PW2. IIRC, both values need to be identical to maintain the aspect ratio.

Recap: the thumbnails on the PW "grid view" fit in 1x1.5".

Your code was:
img.thumbnail((330, 330), Image.ANTIALIAS)
That produced images 330 px high.
For PW1/2 @ 220 ppi, that gave a thumb of 1.5" high; filling the slot. But for PW3, 300 ppi, 1.1", only 3/4 size.

So for PW 3, change to (450,450) and you get full-size thumbs.
Which I tried and it does work.
Maybe you can add a GUI setting for this.
Or default to 450, since it seems the Kindle will downscale if the thumb is too large.

Odd that all the Kindle screens are 4:3 ratio, but the thumbnails are 3:2. So unless you are incredibly fussy and redesign the thumb, one or the other will have whitespace around.

AlanHK 06-11-2017 12:29 PM

A couple more thoughts:
I usually use the "maximum compression" setting; certainly if I'm going to publish it on Amazon. However, this can take a couple of minutes per book. kindlegen uses 99% of processor while doing this; and the PC is unresponsive. I can't even play Solitaire.

Could the priority be set at "idle"? That's what the video and audio encoders I use do; they take only marginally longer to complete (as long as I don't do something else intensive at the same time), and the PC is responsive

And I've set my own ASIN in the OPF, thanks. I make a 10 character mnemonic for the title, so which cover is which is obvious, and the old AZW is overwritten which is what I want rather than having to look at the timestamps to sort out which is the newest version.

eschwartz 06-11-2017 05:15 PM

Quote:

Originally Posted by AlanHK (Post 3534772)
Anyway, I hate the way Calibre copies and renames all my books. Makes it a real pain to use if I'm editing them in Sigil to make adjustments. Much prefer to do it all in Sigil.

Well, I guess you could just as easily use a Sigil plugin that converts the book via calibre's command-line `ebook-convert.exe` which doesn't rename or copy anything. :) That being said, if the only copy is in calibre then you can open the book in Sigil directly from calibre's Open With menu.

Doitsu 06-11-2017 07:42 PM

Quote:

Originally Posted by AlanHK (Post 3535723)
A couple more thoughts:
I usually use the "maximum compression" setting; certainly if I'm going to publish it on Amazon. However, this can take a couple of minutes per book.

When I last tested this, the maximum compression switch reduced the file size only by an additional 10-20%. I.e., it's not really worth the wait, unless you compile a huge dictionary.

Quote:

Originally Posted by AlanHK (Post 3535723)
Could the priority be set at "idle"?

Linux systems have a nice command that does this, however, since you have a Windows machine, you might want to check out third party tools such as Process Tamer (freeware).

AlanHK 06-11-2017 10:46 PM

Quote:

Originally Posted by Doitsu (Post 3535915)
When I last tested this, the maximum compression switch reduced the file size only by an additional 10-20%. I.e., it's not really worth the wait, unless you compile a huge dictionary.

I don't mind waiting, if I can do something else in the meantime.

Quote:

Originally Posted by Doitsu (Post 3535915)
Linux systems have a nice command that does this, however, since you have a Windows machine, you might want to check out third party tools such as Process Tamer (freeware).

I can set priority with Process Explorer which is what is telling me how much each process is using anyway. But I can only do that after the process has started, and when the system is virtually frozen by a high intensity process, it's difficult to switch to that. So, having it set on launch is preferable.

PS -- "Process Tamer" looks like it can react by itself; I'll give it a look. Thanks.

jcsalomon 07-25-2017 10:46 AM

Quote:

Originally Posted by Doitsu (Post 3534820)
You can define your own ASIN number using one of the two following metadata entry formats:

Code:

<dc:identifier opf:scheme="MOBI-ASIN">XXXXXXXXXX</dc:identifier>
<dc:identifier opf:scheme="AMAZON">XXXXXXXXXX</dc:identifier>


In my EPUB3 books, EpubCheck complains about “opf:scheme”. May I request that lines of the form
Code:

<dc:identifier>urn:AMAZON:BXXXXXXXXX</dc:identifier>
also be identified this way? (Calibre already recognizes this version.)

Doitsu 07-25-2017 01:09 PM

Quote:

Originally Posted by jcsalomon (Post 3557922)
In my EPUB3 books, EpubCheck complains about “opf:scheme”. May I request that lines of the form
Code:

<dc:identifier>urn:AMAZON:BXXXXXXXXX</dc:identifier>
also be identified this way? (Calibre already recognizes this version.)

I attached a new version that should recognize this version.

jcsalomon 07-25-2017 01:46 PM

Quote:

Originally Posted by Doitsu (Post 3557992)
I attached a new version that should recognize this version.

Thank you!


All times are GMT -4. The time now is 08:25 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.