03-17-2023, 02:35 PM | #1741 |
Guru
Posts: 758
Karma: 1537886
Join Date: Sep 2013
Device: Kobo Forma
|
In my situation, that titlepage.xhtml is the Cover page that Calibre produces. Jacket.xhtml is the jacket Calibre produces (probably as a result of the "Insert Metadata as Page at Start of Book" option under Structure Detection) and sticks in there (usually immediately after the titlepage.xhtml (i.e. in the 2nd position). Tpage.xhtml is actually a title page (usually, the book has it and I just rename it to that). Since that jacket is a Calibre product (which I like and use), it probably doesn't have a standard position. But, almost always, it's in that second position.
The issue I'm having is that for a very small number of books, Modify ePub just keeps putting it in 3rd position and I can't figure out why. AFAICT, in those "Miscellaneous" files, "jacket" shows up only in the .opf file (two locations: manifest (which is unordered) and spine (which is ordered)). In the problematic books, it doesn't matter where the jacket entry is (or where I drag the file in the File Browser). The plugin just moves it to the 3rd position without any obvious instruction to do so. |
03-17-2023, 02:46 PM | #1742 |
Guru
Posts: 758
Karma: 1537886
Join Date: Sep 2013
Device: Kobo Forma
|
I've attached a scrambled version of one of those books (Naomi Novik's "A Deadly Education"):
https://www.kobo.com/us/en/ebook/a-deadly-education-2 Last edited by enuddleyarbl; 03-17-2023 at 02:57 PM. |
Advert | |
|
03-17-2023, 03:58 PM | #1743 | |
Resident Curmudgeon
Posts: 76,986
Karma: 138588794
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
03-17-2023, 04:00 PM | #1744 | |
Resident Curmudgeon
Posts: 76,986
Karma: 138588794
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
03-17-2023, 04:26 PM | #1745 |
Guru
Posts: 758
Karma: 1537886
Join Date: Sep 2013
Device: Kobo Forma
|
Where is that order being set in the book?
|
Advert | |
|
03-17-2023, 04:36 PM | #1746 |
Resident Curmudgeon
Posts: 76,986
Karma: 138588794
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
03-17-2023, 04:55 PM | #1747 |
Guru
Posts: 758
Karma: 1537886
Join Date: Sep 2013
Device: Kobo Forma
|
Except if I change the order in the spine so the jacket is in the 2nd position, Modify ePub puts it back (in some books) to the 3rd position. In most books, though, it'll put the jacket back into the 2nd position. There's got to be something, somewhere, that Modify ePub is seeing that tells it to move that file to some location regardless of what the spine says. But, darned if I can find it.
|
03-17-2023, 05:10 PM | #1748 | |
Resident Curmudgeon
Posts: 76,986
Karma: 138588794
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
03-17-2023, 05:46 PM | #1749 |
null operator (he/him)
Posts: 21,118
Karma: 27620706
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
FWIW: Modify has an option to put the 'jacket' at the back of the book. That option may have been added at my request, if not I certainly welcomed it.
BR |
03-17-2023, 08:03 PM | #1750 |
Guru
Posts: 758
Karma: 1537886
Join Date: Sep 2013
Device: Kobo Forma
|
Just sticking various of Modify ePub's modules into Notepad++, I think I was able to find the issue. It looks like this is handled in add_replace_jacket and is_cover_or_title_id of jacket.py:
Code:
... # Next add it to the spine. We want it at the start of the book, but # after the Calibre titlepage and cover image. # TODO: Might want to make this a bit more bulletproof by looking at the guide etc. insert_pos = 1 spine_items = list(container.get_spine_items()) while insert_pos < len(spine_items): spine_id = spine_items[insert_pos].get('id').lower() if not is_cover_or_title_id(spine_id): break insert_pos += 1 if jacket_end_book: insert_pos = -1 container.add_to_spine(id, index=insert_pos) container.set(container.opf_name, container.opf) return True def is_cover_or_title_id(spine_id): return spine_id.startswith('cvi') or spine_id.startswith('cover') or spine_id.startswith('titlepage') or spine_id.startswith('tp') I don't see how Modify ePub could change its behavior to handle all cases (it mentions a TODO of checking the guide -- but there IS no guide in this particular book), so it looks like the work-around (assuming this bothers me enough to do it) is to change the id of that tpage.xhtml file to something not starting in "tp" in both the manifest and the spine. QED. At least I understand what I'm seeing, now. Last edited by enuddleyarbl; 03-17-2023 at 09:49 PM. Reason: Why do I keep putting apostrophes where they don't belong? |
03-19-2023, 11:21 AM | #1751 |
Guru
Posts: 758
Karma: 1537886
Join Date: Sep 2013
Device: Kobo Forma
|
@kiwidude: I've been pounding my head against a wall trying to set up VS Code to work with Calibre and plugins. I just found your Contributing page for your Github repository:
https://github.com/kiwidude68/calibr...ONTRIBUTING.md and I'd like to thank you for that. That should help me tremendously in getting the environment set up. |
10-07-2023, 01:07 AM | #1752 |
Calibre Plugins Developer
Posts: 4,692
Karma: 2162246
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
Modify ePub v1.8.2
Release Notes
https://github.com/kiwidude68/calibr...fy_epub-v1.8.2 An important fix in this one to handle badly named html files in the manifest such as with spaces/brackets in them. Somewhere along the way things got messed up (or maybe always broken), which meant if you did something like "Remove unmanifested files" then these poorly named files would get removed even though they do exist in the epub. |
03-17-2024, 12:41 AM | #1753 |
Calibre Plugins Developer
Posts: 4,692
Karma: 2162246
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
Modify ePub v1.8.3
Release Notes
https://github.com/kiwidude68/calibr...fy_epub-v1.8.3 |
07-08-2024, 08:02 AM | #1754 |
Calibre Plugins Developer
Posts: 4,692
Karma: 2162246
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
Modify ePub v1.8.4
Release Notes
https://github.com/kiwidude68/calibr...fy_epub-v1.8.4 As suggested by JSWolf, update the matching remove unused images for the change made recently in Quality Check, |
07-08-2024, 08:03 AM | #1755 | |
Resident Curmudgeon
Posts: 76,986
Karma: 138588794
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
Tags |
modify epub |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[GUI Plugin] Quality Check | kiwidude | Plugins | 1226 | 11-22-2024 09:27 AM |
[GUI Plugin] Manage Series | kiwidude | Plugins | 167 | 07-28-2024 04:07 PM |
[GUI Plugin] Open With | kiwidude | Plugins | 403 | 04-01-2024 09:39 AM |
Modify ePub plugin dev thread | kiwidude | Development | 346 | 09-02-2013 06:14 PM |
[GUI Plugin] Plugin Updater **Deprecated** | kiwidude | Plugins | 159 | 06-19-2011 01:27 PM |