![]() |
#1606 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
EDIT: If you have customized the jacket template CSS then you must hand-port the changes to the default template into your custom one. The changed lines are: Code:
/* Uncomment the next line to remove 'Series' from banner section */ /* table.cbj_header tr.cbj_series { display: none } */ /* Uncomment the next line to remove 'Published (year of publication)' from banner section */ /* table.cbj_header tr.cbj_pubdata { display:none } */ /* Uncomment the next line to remove 'Rating' from banner section */ /* table.cbj_header tr.cbj_rating { display:none } */ /* Uncomment the next line to remove 'Tags' from banner section */ /* table.cbj_header tr.cbj_tags { display:none } */ Code:
table.cbj_header tr.cbj_series { /* Uncomment the next line to remove 'Series' from banner section */ /* display:none; */ } Last edited by chaley; 04-18-2022 at 11:54 AM. Reason: Added some info about the fix |
|
![]() |
![]() |
![]() |
#1607 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,752
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
![]() |
![]() |
![]() |
#1608 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
For epub2 is isn't clear. The specs are so convoluted that I gave up. The are valid XML. The aren't valid HTML4. Depends on which spec wins. And in any event, if you don't like it then take it out of the jacket template. |
|
![]() |
![]() |
![]() |
#1609 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 776
Karma: 1538394
Join Date: Sep 2013
Device: Kobo Forma
|
I'm having an issue with Modify ePub on Linux (Fedora). The thread where I started talking about the issue is:
https://www.mobileread.com/forums/sh...d.php?t=346383 When I run Modify ePub (which I have set to Remove Broken TOC Entries in NCX File (among other things)) against an ePub, it deletes the contents of the ncx.toc (specifically, everything between the <navMap> tags). At first, I thought the problem was with my thrashing around in the Calibre Editor. But, I just tried it with an epub that it was working with just fine on Windows a week or so ago, and it did the same thing. So, I'm assuming it's something to do with the plugin on Linux. I don't know if I should reproduce all the data from that other thread in this one. Let me know if you need anything and I'll try to figure out how to do it. Calibre 5.41 installed via the Binary Install command at: https://calibre-ebook.com/download_linux Modify ePub 1.7.0 installed from Calibre's Plugin Manager/Installer thing under Preferences Operating System: Fedora Linux 35 KDE Plasma Version: 5.24.4 KDE Frameworks Version: 5.91.0 Qt Version: 5.15.2 Kernel Version: 5.16.20-200.fc35.x86_64 (64-bit) Graphics Platform: Wayland Processors: 12 × AMD Ryzen 5 5600X 6-Core Processor Memory: 15.6 GiB of RAM Graphics Processor: AMD Radeon RX 6700 XT EDIT: I started up Calibre in debug mode and ran Modify ePub against an ePub with just the option to remove bad ToC links turned on. Nothing really showed up except some possible issues with KoboTouchExtended. But, here's what was there: Code:
[dave@davesfedora ~]$ calibre-debug -g calibre 5.41 embedded-python: True is64bit: True Linux-5.16.20-200.fc35.x86_64-x86_64-with-glibc2.2.5 Linux ('64bit', 'ELF') ('Linux', '5.16.20-200.fc35.x86_64', '#1 SMP PREEMPT Wed Apr 13 22:09:20 UTC 2022') Python 3.8.5 Interface language: None DEBUG: 0.0 GetFileName::__init__.py - loading translations Successfully initialized third party plugins: DeACSM (0, 0, 15) && DeDRM (10, 0, 2) && EpubCheck (0, 2, 4) && GetFileName (0, 1, 1) && Goodreads (1, 5, 3) && Kobo Utilities (2, 15, 1) && KoboTouchExtended (3, 5, 4) && Modify ePub (1, 7, 0) && Quality Check (1, 12, 0) && ScrambleEbook (0, 4, 5) Not controlling automatic hidpi scaling devicePixelRatio: 1.0 logicalDpi: 109.0 x 109.0 physicalDpi: 109.21999999999998 x 110.83636363636363 Using calibre Qt style: True [0.00] Starting up... [0.00] Initializing db... [0.01] db initialized [0.01] Constructing main UI... DEBUG: 0.0 Kobo Utilities Configuration - CreateNewCustomColumn is supported DEBUG: 0.0 KoboUtilites::action.py - loading translations DEBUG: 0.0 KoboUtilites::dialogs.py - loading translations DEBUG: 0.0 KoboUtilites::action.py - loading translations DEBUG: 0.3 No Kobo Touch, Glo or Mini appears to be connected DEBUG: 0.3 rebuild_menus - self.supports_ratings=None, self.supports_tiles=None DEBUG: 0.3 KoboUtilities:set_toolbar_button_tooltip - start: text='None' DEBUG: 0.3 KoboUtilities:set_toolbar_button_tooltip - setting to text='Utilities to use with Kobo ereaders Driver: KoboTouchExtended' [0.47] main UI initialized... [0.47] Started up in 0.47 seconds with 2 books Starting QuickView Worker Launch took: 0.01 seconds Job: 0 Modify ePubs version (1, 7, 0) finished Modify ePubs version (1, 7, 0) Logfile for book ID 2 (Piccadilly Jim / PG Wodehouse) Job details 2 Modifying: /tmp/calibre_5.41.0_tmp_3aehiese/_o9b_ln2_modify_epub/2.epub Parsing xml file: content.opf Parsing xml file: toc.ncx Looking for broken links in the NCX TOC Navpoint broken to remove of: toc.xhtml TOC Navpoint broken to remove of: text/Chapter-01.html TOC Navpoint broken to remove of: text/Chapter-02.html TOC Navpoint broken to remove of: text/Chapter-03.html TOC Navpoint broken to remove of: text/Chapter-04.html TOC Navpoint broken to remove of: text/Chapter-05.html TOC Navpoint broken to remove of: text/Chapter-06.html TOC Navpoint broken to remove of: text/Chapter-07.html TOC Navpoint broken to remove of: text/Chapter-08.html TOC Navpoint broken to remove of: text/Chapter-09.html TOC Navpoint broken to remove of: text/Chapter-10.html TOC Navpoint broken to remove of: text/Chapter-11.html TOC Navpoint broken to remove of: text/Chapter-12.html TOC Navpoint broken to remove of: text/Chapter-13.html TOC Navpoint broken to remove of: text/Chapter-14.html TOC Navpoint broken to remove of: text/Chapter-15.html TOC Navpoint broken to remove of: text/Chapter-16.html TOC Navpoint broken to remove of: text/Chapter-17.html TOC Navpoint broken to remove of: text/Chapter-18.html TOC Navpoint broken to remove of: text/Chapter-19.html TOC Navpoint broken to remove of: text/Chapter-20.html TOC Navpoint broken to remove of: text/Chapter-21.html TOC Navpoint broken to remove of: text/Chapter-22.html TOC Navpoint broken to remove of: text/Chapter-23.html TOC Navpoint broken to remove of: text/Chapter-24.html TOC Navpoint broken to remove of: text/Chapter-25.html TOC Navpoint broken to remove of: text/Chapter-26.html ePub updated in 0.05 seconds Worker Launch took: 0.00 seconds Failed to initialize plugin: '/home/dave/.config/calibre/plugins/KoboTouchExtended.zip' [dave@davesfedora ~]$ Last edited by enuddleyarbl; 04-22-2022 at 05:39 PM. |
![]() |
![]() |
![]() |
#1610 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
There is one possibility I see in the code. The check to see if a file exists checks the lower-case name against the "real" name. However, the code assumes that the path to the temporary epub is lower case, something that might be true on Windows but not on linux. The attached test version fixes that. Does it work for you? EDIT: removed the test version Last edited by chaley; 04-23-2022 at 08:35 AM. Reason: replaced the test version |
|
![]() |
![]() |
![]() |
#1611 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 776
Karma: 1538394
Join Date: Sep 2013
Device: Kobo Forma
|
Quote:
Code:
Modify ePubs version (1, 7, 1) Logfile for book ID 3 (Piccadilly Jim / PG Wodehouse) Job details 3 Modifying: /tmp/calibre_5.41.0_tmp_g3uxi4fc/a19xmmy0_modify_epub/3.epub Parsing xml file: content.opf Parsing xml file: toc.ncx Looking for broken links in the NCX TOC Navpoint broken to remove of: toc.xhtml TOC Navpoint broken to remove of: text/Chapter-01.html TOC Navpoint broken to remove of: text/Chapter-02.html TOC Navpoint broken to remove of: text/Chapter-03.html TOC Navpoint broken to remove of: text/Chapter-04.html TOC Navpoint broken to remove of: text/Chapter-05.html TOC Navpoint broken to remove of: text/Chapter-06.html TOC Navpoint broken to remove of: text/Chapter-07.html TOC Navpoint broken to remove of: text/Chapter-08.html TOC Navpoint broken to remove of: text/Chapter-09.html TOC Navpoint broken to remove of: text/Chapter-10.html TOC Navpoint broken to remove of: text/Chapter-11.html TOC Navpoint broken to remove of: text/Chapter-12.html TOC Navpoint broken to remove of: text/Chapter-13.html TOC Navpoint broken to remove of: text/Chapter-14.html TOC Navpoint broken to remove of: text/Chapter-15.html TOC Navpoint broken to remove of: text/Chapter-16.html TOC Navpoint broken to remove of: text/Chapter-17.html TOC Navpoint broken to remove of: text/Chapter-18.html TOC Navpoint broken to remove of: text/Chapter-19.html TOC Navpoint broken to remove of: text/Chapter-20.html TOC Navpoint broken to remove of: text/Chapter-21.html TOC Navpoint broken to remove of: text/Chapter-22.html TOC Navpoint broken to remove of: text/Chapter-23.html TOC Navpoint broken to remove of: text/Chapter-24.html TOC Navpoint broken to remove of: text/Chapter-25.html TOC Navpoint broken to remove of: text/Chapter-26.html ePub updated in 0.05 seconds |
|
![]() |
![]() |
![]() |
#1612 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 776
Karma: 1538394
Join Date: Sep 2013
Device: Kobo Forma
|
Addition to the above: I also ran the test Modify ePub against another epub that worked fine with it about 2 weeks ago in Windows and had the same problem. It didn't like any of the toc.ncx entries and removed them.
|
![]() |
![]() |
![]() |
#1613 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 776
Karma: 1538394
Join Date: Sep 2013
Device: Kobo Forma
|
I also figured out that if I rename the epub as a zip file I can look at the actual files in it. I did so with the one where I renamed the files to lower-case and, yes, they were all actually in lower-case (and that's what the toc.ncx was looking for). I did the same for the earlier version (with the upper-case "Chapter-*" and those text files were, in fact, named with upper-case "C"s and, again, that's what the toc.ncx was looking for.
|
![]() |
![]() |
![]() |
#1614 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 776
Karma: 1538394
Join Date: Sep 2013
Device: Kobo Forma
|
You mentioned case differences. How about path differences? Linux uses "/", while Windows uses "\". I'm just throwing that out. I'm utterly clueless about this though.
|
![]() |
![]() |
![]() |
#1615 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,054
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
|
|
![]() |
![]() |
![]() |
#1616 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 776
Karma: 1538394
Join Date: Sep 2013
Device: Kobo Forma
|
I don't know if this is related to the deletion of ToC elements in Linux, but I'm also seeing something odd with non dc: elements. I've got the removal of those turned on in Modify ePub. I tried yet another epub (getting the same ToC issues as before) and it looks like it removes 15 (blank children?) of them every time it runs (I am having it replace the book on disk after the runs). Similarly, in each run, it looks like it's finding the same things to remove from the cover and the titlepage, even though it replaces them with clean versions at the end. Unfortunately, I don't remember if I had anything similar when I was doing this on Windows. Anyway, here's two back-to-back runs on the same book:
Code:
Modify ePubs version (1, 7, 1) Logfile for book ID 4 (Pride and Prejudice / Jane Austen) Job details 4 Modifying: /tmp/calibre_5.41.0_tmp_xsagt2wt/pa1tb0ow_modify_epub/4.epub Updating metadata and cover Parsing xml file: content.opf Parsing xml file: toc.ncx Looking for redundant entries in manifest Looking for unmanifested files Looking for Adobe xpgt files and links to remove Looking for pagemaps Looking for Google Play pagemaps Looking for Adobe DRM meta tags to remove Looking for legacy jackets Adding or updating jacket Current jacket removed: jacket.xhtml Manifest item removed: jacket.xhtml (calibre_jacket) Spine itemref removed: calibre_jacket Manifest item added: jacket.xhtml (calibre_jacket) Spine item inserted: calibre_jacket at pos: 1 Looking for html pages containing only broken image links Looking for non dc: elements in manifest Removing child: Removing child: Removing child: Removing child: Removing child: Removing child: Removing child: Removing child: Removing child: Removing child: Removing child: Removing child: Removing child: Removing child: Removing child: Looking for html files to remove charset meta tags/encode to utf-8 Switched to UTF-8 encoding for: text/titlepage.xhtml Looking for CSS margins Looking for inline javascript blocks to remove Looking for .js files to remove Applying smarten punctuation Stripping Kobo remnants Stripped Kobo spans in: text/titlepage.xhtml Looking for files to remove: ['iTunesMetadata.plist', 'iTunesArtwork'] Looking for files to remove: ['META-INF/calibre_bookmarks.txt'] Looking for files to remove: ['.DS_Store', 'thumbs.db'] Looking for unused images Stripping spans Unprettying files De-indented: text/titlepage.xhtml Insert or replace cover ...Looking for guide cover reference Found guide cover reference to: text/titlepage.xhtml Related manifest item id: titlepage ...Looking for meta cover ...Looking for other.ms-* guide references to clean out ...Working with possible existing cover: text/titlepage.xhtml Guide reference removed: text/titlepage.xhtml ...Looking for TOC navpoint for this cover ...Inspecting old cover for removal Cover page contains only this image so can be deleted Manifest item removed: text/titlepage.xhtml (titlepage) Spine itemref removed: titlepage Checking safe to remove cover image: cover.jpeg No other html pages use this image, safe to remove Manifest item removed: cover.jpeg (cover) ...Writing new cover image and titlepage html New cover image written to: cover.jpeg New titlepage html written to: text/titlepage.xhtml ...Updating manifest and TOC for the new cover Manifest item added: text/titlepage.xhtml (titlepage) Manifest item added: cover.jpeg (cover) Meta item inserted: cover:cover Spine item inserted: titlepage at pos: 0 Guide item inserted: text/titlepage.xhtml:Cover:cover ...Remove any orphaned guide images ...Apply device specific fixes ...Cover modifications completed ePub updated in 1.06 seconds Code:
Modify ePubs version (1, 7, 1) Logfile for book ID 4 (Pride and Prejudice / Jane Austen) Job details 4 Modifying: /tmp/calibre_5.41.0_tmp_xsagt2wt/yoy2hyjx_modify_epub/4.epub Updating metadata and cover Parsing xml file: content.opf Parsing xml file: toc.ncx Looking for redundant entries in manifest Looking for unmanifested files Looking for Adobe xpgt files and links to remove Looking for pagemaps Looking for Google Play pagemaps Looking for Adobe DRM meta tags to remove Looking for legacy jackets Adding or updating jacket Current jacket removed: jacket.xhtml Manifest item removed: jacket.xhtml (calibre_jacket) Spine itemref removed: calibre_jacket Manifest item added: jacket.xhtml (calibre_jacket) Spine item inserted: calibre_jacket at pos: 1 Looking for html pages containing only broken image links Looking for non dc: elements in manifest Removing child: Removing child: Removing child: Removing child: Removing child: Removing child: Removing child: Removing child: Removing child: Removing child: Removing child: Removing child: Removing child: Removing child: Removing child: Looking for html files to remove charset meta tags/encode to utf-8 Switched to UTF-8 encoding for: text/titlepage.xhtml Looking for CSS margins Looking for inline javascript blocks to remove Looking for .js files to remove Applying smarten punctuation Stripping Kobo remnants Stripped Kobo spans in: text/titlepage.xhtml Looking for files to remove: ['iTunesMetadata.plist', 'iTunesArtwork'] Looking for files to remove: ['META-INF/calibre_bookmarks.txt'] Looking for files to remove: ['.DS_Store', 'thumbs.db'] Looking for unused images Stripping spans Unprettying files De-indented: text/titlepage.xhtml Insert or replace cover ...Looking for guide cover reference Found guide cover reference to: text/titlepage.xhtml Related manifest item id: titlepage ...Looking for meta cover ...Looking for other.ms-* guide references to clean out ...Working with possible existing cover: text/titlepage.xhtml Guide reference removed: text/titlepage.xhtml ...Looking for TOC navpoint for this cover ...Inspecting old cover for removal Cover page contains only this image so can be deleted Manifest item removed: text/titlepage.xhtml (titlepage) Spine itemref removed: titlepage Checking safe to remove cover image: cover.jpeg No other html pages use this image, safe to remove Manifest item removed: cover.jpeg (cover) ...Writing new cover image and titlepage html New cover image written to: cover.jpeg New titlepage html written to: text/titlepage.xhtml ...Updating manifest and TOC for the new cover Manifest item added: text/titlepage.xhtml (titlepage) Manifest item added: cover.jpeg (cover) Meta item inserted: cover:cover Spine item inserted: titlepage at pos: 0 Guide item inserted: text/titlepage.xhtml:Cover:cover ...Remove any orphaned guide images ...Apply device specific fixes ...Cover modifications completed ePub updated in 1.08 seconds |
![]() |
![]() |
![]() |
#1617 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
At this point I am at a loss. It can't be that the plugin simply doesn't work on Linux; we would have been told that by now. That says that something is odd about your installation.
These books seem to be out of copyright. Can you either send me a copy of the ones that are breaking, especially one where it removes the entries from the ncx? Send them to modepub [at] charleshaley [dot] org. I don't have a linux machine but I might be able to see something. More questions:
|
![]() |
![]() |
![]() |
#1618 | |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 167
Karma: 1497966
Join Date: Jul 2021
Device: N/A
|
I confirm the issue in linux.
Running debian stable, calibre 5.99, modifyepub installed today using the calibre plugin installer. Filesystem: ext4 on a local HD Ebook (Zola - Nana) is in the public domain (downloaded from www.ebooksgratuits.com), copy provided below. I checked (and corrected all) errors and beautified the book in calibre editor. No error in epubcheck. Modifyepub was set to "remove broken ToC entries" and "remove non dc: metadata" Running modifiyepub: All ToC entries are removed. Three non-dc: entries are correctly removed from the opf. Log: Spoiler:
Book before and after : https://www40.zippyshare.com/v/8fNzJKvO/file.html Checked with 3 other books, always the same issue. Quote:
2) yes (you have the copy in the zip I provided above) 3) yes it has 3) yes, local ext4 system ___________ To DaveLessnau: In my case, the "Removing child" were entries in the opf, as those ones: <meta name="cover" content="img1"/> <meta name="calibre:title_sort" content="Nana"/> The removal of those elements is legitimate, they are NOT dc: entries, so maybe this is also the case in your ebook? Last edited by lomkiri; 04-23-2022 at 07:51 AM. |
|
![]() |
![]() |
![]() |
#1619 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Attached is a version of the plugin that logs more about what it is doing with the ncx. Could you install it and post the log? |
|
![]() |
![]() |
![]() |
#1620 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 167
Karma: 1497966
Join Date: Jul 2021
Device: N/A
|
The problem seems to come from the test in test_navpoint_for_removal(), in container.py:
link_path.lower() is tested against each dict.key, but link_path is only a substring of the key, so it fails. I've ran this code (modifying delete_broken_toc_links()): Code:
print(f'html_names_map {html_names_map}') def test_navpoint_for_removal(navpoint): src = navpoint.xpath('ncx:content/@src', namespaces={'ncx':NCX_NS}) print(f'\nnavpoint {navpoint}\nsrc {src}') if len(src): src = urlunquote(src[0]).partition('#')[0] link_path = self.abshref(src, self.ncx_name) if link_path.lower() not in html_names_map: self.log('\t TOC Navpoint broken to remove of:', src) print('link_path {} | link_path in html_names_map: {}, lowered: {}'.format(link_path, link_path in html_names_map, link_path.lower() in html_names_map)) return True return False Spoiler:
|
![]() |
![]() |
![]() |
Tags |
modify epub |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[GUI Plugin] Quality Check | kiwidude | Plugins | 1251 | 07-07-2025 09:13 PM |
[GUI Plugin] Open With | kiwidude | Plugins | 404 | 02-21-2025 05:42 AM |
[GUI Plugin] Manage Series | kiwidude | Plugins | 167 | 07-28-2024 03:07 PM |
Modify ePub plugin dev thread | kiwidude | Development | 346 | 09-02-2013 05:14 PM |
[GUI Plugin] Plugin Updater **Deprecated** | kiwidude | Plugins | 159 | 06-19-2011 12:27 PM |