View Single Post
Old 10-22-2025, 03:11 PM   #1
un_pogaz
Chalut o/
un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.
 
un_pogaz's Avatar
 
Posts: 495
Karma: 678910
Join Date: Dec 2017
Device: Kobo
Bug: duplicate manifest file entry

So, I enconter a malfomerd OPF that duplicate manifest file entry (two <item> for the same file with different ids) with one "orphan" (not referenced into the spine).

Example:
Code:
  <manifest>
    <item id="DeVilliersGerard-SAS-110TUEZRIGOBERTAMENCHU_split_000" href="Text/DeVilliersGerard-SAS-110TUEZRIGOBERTAMENCHU_split_000.html" media-type="application/xhtml+xml"/>
    <item id="DeVilliersGerard-SAS-110TUEZRIGOBERTAMENCHU_split_001" href="Text/DeVilliersGerard-SAS-110TUEZRIGOBERTAMENCHU_split_001.html" media-type="application/xhtml+xml"/>
    <item id="DeVilliersGerard-SAS-110TUEZRIGOBERTAMENCHU_split_002" href="Text/DeVilliersGerard-SAS-110TUEZRIGOBERTAMENCHU_split_002.html" media-type="application/xhtml+xml"/>
    <item id="id0" href="Text/DeVilliersGerard-SAS-110TUEZRIGOBERTAMENCHU_split_000.html" media-type="application/xhtml+xml"/>
    <item id="id1" href="Text/DeVilliersGerard-SAS-110TUEZRIGOBERTAMENCHU_split_001.html" media-type="application/xhtml+xml"/>
    <item id="id2" href="Text/DeVilliersGerard-SAS-110TUEZRIGOBERTAMENCHU_split_002.html" media-type="application/xhtml+xml"/>
    <item id="ncx" href="toc.ncx" media-type="application/x-dtbncx+xml"/>
    <item id="titlepage.xhtml" href="Text/titlepage.xhtml" media-type="application/xhtml+xml"/>
  </manifest>
  <spine toc="ncx">
    <itemref idref="titlepage.xhtml"/>
    <itemref idref="id0"/>
    <itemref idref="id1"/>
    <itemref idref="id2"/>
  </spine>
As it stands, this is fairly harmless, Sigil work fine wihout enconter any issue.
Unless you launch a plugin that iterates through all the text files with "text_iter()". The plugin will fail because try to read the "orphan" entry that is not referenced into the spine.

Code:
Statut : failed

file: titlepage.xhtml
html_id: titlepage.xhtml
file: DeVilliersGerard-SAS-110TUEZRIGOBERTAMENCHU_split_000.html
html_id: id0
file: DeVilliersGerard-SAS-110TUEZRIGOBERTAMENCHU_split_001.html
html_id: id1
file: DeVilliersGerard-SAS-110TUEZRIGOBERTAMENCHU_split_002.html
html_id: id2
file: DeVilliersGerard-SAS-110TUEZRIGOBERTAMENCHU_split_000.html
html_id: DeVilliersGerard-SAS-110TUEZRIGOBERTAMENCHU_split_000
Traceback (most recent call last):
  File "/usr/share/sigil/plugin_launchers/python/launcher.py", line 142, in launch
    self.exitcode = target_script.run(container)
                    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/mnt/home/un_pogaz/.local/share/sigil-ebook/sigil/plugins/CleanMSO/plugin.py", line 16, in run
    text = bk.readfile(html_id)
  File "/usr/share/sigil/plugin_launchers/python/bookcontainer.py", line 176, in readfile
    return self._w.readfile(id)
           ~~~~~~~~~~~~~~~~^^^^
  File "/usr/share/sigil/plugin_launchers/python/wrapper.py", line 625, in readfile
    raise WrapperException('Id does not exist in manifest')
wrapper.WrapperException: Id does not exist in manifest
Error: Id does not exist in manifest
And no, its not me who play with the OPF, I found the epub as it.

Last edited by un_pogaz; 10-22-2025 at 05:41 PM.
un_pogaz is offline   Reply With Quote