Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 04-18-2022, 08:40 AM   #1606
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by chaley View Post
  • The empty stylesheet declarations are generated by calibre's built-in jacket builder, not this plugin. The calibre editor flags them as errors, but epubcheck doesn't care about them. I have a possible fix I will send to Kovid.
The fix, a better one by Kovid, is now in master calibre source.

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 } */
The old ones look like this:
Code:
table.cbj_header tr.cbj_series {
    /* Uncomment the next line to remove 'Series' from banner section */
    /* display:none; */
    }
You should use the new lines if you haven't "uncomment[ed] the next line" in the old version.

Last edited by chaley; 04-18-2022 at 11:54 AM. Reason: Added some info about the fix
chaley is offline   Reply With Quote
Old 04-18-2022, 10:39 AM   #1607
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,750
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by chaley View Post
However, this is a case where epubcheck is wrong. The global attribute data-calibre-jacket-searchable-tags="1" is perfectly legal (here, here).

According to Kovid, adding these tags is deliberate. He said in a bug report:

If you know you don't want them then create a custom book jacket template and remove the line
Code:
<tr data-calibre-jacket-searchable-tags="1" style="color:white; display:none"><td colspan="2">{searchable_tags}</td></tr>
in jacket/template.xhtml.
While it is valid HTML code, is it valid ePub code in ePub2 and ePub3?
JSWolf is offline   Reply With Quote
Advert
Old 04-18-2022, 11:48 AM   #1608
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by JSWolf View Post
While it is valid HTML code, is it valid ePub code in ePub2 and ePub3?
They are valid in epub3.

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.
chaley is offline   Reply With Quote
Old 04-22-2022, 05:18 PM   #1609
enuddleyarbl
Guru
enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.
 
enuddleyarbl's Avatar
 
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.
enuddleyarbl is offline   Reply With Quote
Old 04-22-2022, 06:33 PM   #1610
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by DaveLessnau View Post
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
That error says that the file referred to in the navpoint isn't in the epub with a valid relative reference. More precisely, it checks that the reference points to a real file in the exploded copy of the epub. The error says that the files "text/Chapter*" don't exist relative to the base of the epub.

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
chaley is offline   Reply With Quote
Advert
Old 04-22-2022, 07:19 PM   #1611
enuddleyarbl
Guru
enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.
 
enuddleyarbl's Avatar
 
Posts: 776
Karma: 1538394
Join Date: Sep 2013
Device: Kobo Forma
Quote:
Originally Posted by chaley View Post
That error says that the file referred to in the navpoint isn't in the epub with a valid relative reference. More precisely, it checks that the reference points to a real file in the exploded copy of the epub. The error says that the files "text/Chapter*" don't exist relative to the base of the epub.

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: replaced the test version
Unfortunately, no. Same issue. Here's the log of using the new Modify ePub with just the ToC turned on:

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
Based on your comment about the case of the file names, I went back into the document in Calibre Editor, had it merge all the text files, had it split them back at the h2 tags, and then had it bulk rename all the new files. But, this time, instead of accepting the default "Chapter-" for the prefix, I changed it to all lower case "chapter-". I then had it create a ToC and then the Inline ToC from the Tools menu. I checked everything with RunEpubCheck and it was happy. I did the Modify ePub with only the ToC check, and it still removed all the ToC entries in toc.ncx.
enuddleyarbl is offline   Reply With Quote
Old 04-22-2022, 07:22 PM   #1612
enuddleyarbl
Guru
enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.
 
enuddleyarbl's Avatar
 
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.
enuddleyarbl is offline   Reply With Quote
Old 04-22-2022, 07:29 PM   #1613
enuddleyarbl
Guru
enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.
 
enuddleyarbl's Avatar
 
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.
enuddleyarbl is offline   Reply With Quote
Old 04-22-2022, 07:35 PM   #1614
enuddleyarbl
Guru
enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.
 
enuddleyarbl's Avatar
 
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.
enuddleyarbl is offline   Reply With Quote
Old 04-22-2022, 07:47 PM   #1615
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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:
Originally Posted by DaveLessnau View Post
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.
No need to change the name. Calibre has U(npack) built in
theducks is offline   Reply With Quote
Old 04-22-2022, 10:08 PM   #1616
enuddleyarbl
Guru
enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.
 
enuddleyarbl's Avatar
 
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
Immediately running it again after letting replace the version on disk:

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
enuddleyarbl is offline   Reply With Quote
Old 04-23-2022, 01:35 AM   #1617
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
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:
  • You are accepting the changes when the plugin finishes?
  • Are you sure the files are being written back to the library? Please note the mod time, run the plugin, then check that the time and size changed.
  • Check the permissions on the book to be sure that calibre has write permission on the directory.
  • Are you using "normal" Linux file systems to store the library? Not a NAS, not an external drive?
chaley is offline   Reply With Quote
Old 04-23-2022, 07:46 AM   #1618
lomkiri
Groupie
lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.
 
lomkiri's Avatar
 
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:

Modify ePubs version (1, 7, 0)
Logfile for book ID 594 (Nana / Émile Zola)
Job details 594
Modifying: /tmp/calibre_5.99.8_tmp_l1jh41m1/f3tsz1ea_modify_epub/594.epub
Parsing xml file: Ops/content.opf
Parsing xml file: Ops/toc.ncx
Looking for broken links in the NCX
TOC Navpoint broken to remove of: 1.html
TOC Navpoint broken to remove of: 3.html
TOC Navpoint broken to remove of: 4.html
TOC Navpoint broken to remove of: 5.html
TOC Navpoint broken to remove of: 6.html
TOC Navpoint broken to remove of: 7.html
TOC Navpoint broken to remove of: 8.html
TOC Navpoint broken to remove of: 9.html
TOC Navpoint broken to remove of: 10.html
TOC Navpoint broken to remove of: 11.html
TOC Navpoint broken to remove of: 12.html
TOC Navpoint broken to remove of: 13.html
TOC Navpoint broken to remove of: 14.html
TOC Navpoint broken to remove of: 15.html
TOC Navpoint broken to remove of: 16.html
TOC Navpoint broken to remove of: 17.html
Looking for non dc: elements in manifest
Removing child:
Removing child:
Removing child:
ePub updated in 0.34 seconds

Book before and after : https://www40.zippyshare.com/v/8fNzJKvO/file.html

Checked with 3 other books, always the same issue.

Quote:
You are accepting the changes when the plugin finishes?
Are you sure the files are being written back to the library? Please note the mod time, run the plugin, then check that the time and size changed.
Check the permissions on the book to be sure that calibre has write permission on the directory.
Are you using "normal" Linux file systems to store the library? Not a NAS, not an external drive?
1) yes
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.
lomkiri is offline   Reply With Quote
Old 04-23-2022, 09:28 AM   #1619
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by lomkiri View Post
I confirm the issue in linux.
Running debian stable, calibre 5.99, modifyepub installed today using the calibre plugin installer.
I can't see what might be going wrong.

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?
Attached Files
File Type: zip Modify ePub_1_7_1.zip (78.4 KB, 101 views)
chaley is offline   Reply With Quote
Old 04-23-2022, 10:13 AM   #1620
lomkiri
Groupie
lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.
 
lomkiri's Avatar
 
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
which gives this log:
Spoiler:
Quote:
Modify ePubs version (1, 7, 0)
Logfile for book ID 594 (Nana / Émile Zola)
Job details 594
Modifying: /tmp/calibre_5.99.8_tmp_fc8ryo62/cx_qk4o0_modify_epub/594.epub
Parsing xml file: Ops/content.opf
Parsing xml file: Ops/toc.ncx
Looking for broken links in the NCX
html_names_map {
'/tmp/calibre_5.99.8_tmp_fc8ryo62/ops/16.html': True
'/tmp/calibre_5.99.8_tmp_fc8ryo62/ops/11.html': True
'/tmp/calibre_5.99.8_tmp_fc8ryo62/ops/14.html': True
'/tmp/calibre_5.99.8_tmp_fc8ryo62/ops/8.html': True
'/tmp/calibre_5.99.8_tmp_fc8ryo62/ops/12.html': True
'/tmp/calibre_5.99.8_tmp_fc8ryo62/ops/1.html': True
'/tmp/calibre_5.99.8_tmp_fc8ryo62/ops/3.html': True
'/tmp/calibre_5.99.8_tmp_fc8ryo62/ops/7.html': True
'/tmp/calibre_5.99.8_tmp_fc8ryo62/ops/2.html': True
'/tmp/calibre_5.99.8_tmp_fc8ryo62/ops/10.html': True
'/tmp/calibre_5.99.8_tmp_fc8ryo62/ops/4.html': True
'/tmp/calibre_5.99.8_tmp_fc8ryo62/ops/15.html': True
'/tmp/calibre_5.99.8_tmp_fc8ryo62/ops/9.html': True
'/tmp/calibre_5.99.8_tmp_fc8ryo62/ops/5.html': True
'/tmp/calibre_5.99.8_tmp_fc8ryo62/ops/13.html': True
'/tmp/calibre_5.99.8_tmp_fc8ryo62/ops/17.html': True
'/tmp/calibre_5.99.8_tmp_fc8ryo62/ops/6.html': True
}

navpoint
src ['1.html']
TOC Navpoint broken to remove of: 1.html
link_path Ops/1.html | link_path in html_names_map: False, lowered: False

navpoint
src ['3.html']
TOC Navpoint broken to remove of: 3.html
link_path Ops/3.html | link_path in html_names_map: False, lowered: False

navpoint
src ['4.html']
TOC Navpoint broken to remove of: 4.html
link_path Ops/4.html | link_path in html_names_map: False, lowered: False

navpoint
src ['5.html']
TOC Navpoint broken to remove of: 5.html
link_path Ops/5.html | link_path in html_names_map: False, lowered: False

navpoint
src ['6.html']
TOC Navpoint broken to remove of: 6.html
link_path Ops/6.html | link_path in html_names_map: False, lowered: False

navpoint
src ['7.html']
TOC Navpoint broken to remove of: 7.html
link_path Ops/7.html | link_path in html_names_map: False, lowered: False

navpoint
src ['8.html']
TOC Navpoint broken to remove of: 8.html
link_path Ops/8.html | link_path in html_names_map: False, lowered: False

navpoint
src ['9.html']
TOC Navpoint broken to remove of: 9.html
link_path Ops/9.html | link_path in html_names_map: False, lowered: False

navpoint
src ['10.html']
TOC Navpoint broken to remove of: 10.html
link_path Ops/10.html | link_path in html_names_map: False, lowered: False

navpoint
src ['11.html']
TOC Navpoint broken to remove of: 11.html
link_path Ops/11.html | link_path in html_names_map: False, lowered: False

navpoint
src ['12.html']
TOC Navpoint broken to remove of: 12.html
link_path Ops/12.html | link_path in html_names_map: False, lowered: False

navpoint
src ['13.html']
TOC Navpoint broken to remove of: 13.html
link_path Ops/13.html | link_path in html_names_map: False, lowered: False

navpoint
src ['14.html']
TOC Navpoint broken to remove of: 14.html
link_path Ops/14.html | link_path in html_names_map: False, lowered: False

navpoint
src ['15.html']
TOC Navpoint broken to remove of: 15.html
link_path Ops/15.html | link_path in html_names_map: False, lowered: False

navpoint
src ['16.html']
TOC Navpoint broken to remove of: 16.html
link_path Ops/16.html | link_path in html_names_map: False, lowered: False

navpoint
src ['17.html']
TOC Navpoint broken to remove of: 17.html
link_path Ops/17.html | link_path in html_names_map: False, lowered: False
Looking for non dc: elements in manifest
Removing child:
Removing child:
Removing child:
ePub updated in 0.34 seconds
lomkiri is offline   Reply With Quote
Reply

Tags
modify epub


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 05:53 AM.


MobileRead.com is a privately owned, operated and funded community.