2

My epub document has the following errors (one for each of the 18 images in the epub):

ERROR(RSC-008): story.epub/OEBPS/09_02.xhtml(25,83): Referenced resource is not declared in the OPF manifest.

WARNING(OPF-003): story.epub/story.epub(-1,-1): Item 'OEBPS/images/02.jpg' exists in the EPUB, but is not declared in the OPF manifest.

Why story.epub/story.epub(-1,-1) in the 2nd error? But, continuing on...

Fair enough. So I added them to the opf document, under the <manifest> section (see below) but did not include them in the <spine> section.

The images all disappeared from the EPUB file.

So, I removed those 18 lines and ... everything came back again.

Pour-qu'why?

EPUBZone's EPUB 3 Packaging and Metadata document says:

Each and every resource that is part of the EPUB—every content document, every image, every video and audio file, every font, every style sheet: every individual resource—is documented by an item element in the manifest.

and

Whereas the manifest documents each and every item in the EPUB, in no particular order, the spine provides a default reading order, and it is required to list only those components that are not referenced by other components (primary content).

I've scoured the IDPF spec document and cannot find the solution for myself. A little help, svp?

<?xml version="1.0" encoding="UTF-8"?>
<package xmlns="http://www.idpf.org/2007/opf" version="2.0" unique-identifier="BookId">
    <metadata   xmlns:dc="http://purl.org/dc/elements/1.1/"
                xmlns:opf="http://www.idpf.org/2007/opf">

        <dc:title>The Book That I Wrote</dc:title> 
        <dc:identifier id="BookId">urn:uuid:llasjdflasf</dc:identifier>
        <dc:source>MyBookByMe</dc:source>
        <dc:date>2015</dc:date>
        <dc:rights>Copyright 2015 Me Myself I</dc:rights> 
        <dc:description>Autobiography</dc:description>

        <dc:creator opf:role="aut">Me Myself I</dc:creator>
        <dc:language>en</dc:language> 
        <dc:subject>Biography</dc:subject>
        <dc:subject>AutoBiography</dc:subject>
        <dc:subject>Humour</dc:subject>
        <dc:publisher>Self</dc:publisher>
        <meta name="cover" content="cover-image" />
    </metadata>
    <manifest>
        <item id="ncx" href="toc.ncx" media-type="application/x-dtbncx+xml"/>
        <item id="style" href="stylesheet.css" media-type="text/css"/>
        <item id="pagetemplate" href="page-template.xpgt" media-type="application/vnd.adobe-page-template+xml"/>
        <item id="cover" href="00_cover.xhtml" media-type="application/xhtml+xml"/>
        <item id="cover-image" href="images/00_cover.jpg" media-type="image/jpeg"/>
        <item id="titlepage" href="01_title.xhtml" media-type="application/xhtml+xml"/>
        <item id="copyright" href="02_copyright.xhtml" media-type="application/xhtml+xml"/>
        <item id="disclaimer" href="03_disclaimer.xhtml" media-type="application/xhtml+xml"/>
        <item id="dedication" href="04_dedication.xhtml" media-type="application/xhtml+xml"/>
        <item id="toc" href="05_toc.xhtml" media-type="application/xhtml+xml"/>
        <item id="preface" href="06_preface.xhtml" media-type="application/xhtml+xml"/>
        <item id="s1" href="07_section1.xhtml" media-type="application/xhtml+xml"/>
        <item id="c01" href="08_01.xhtml" media-type="application/xhtml+xml"/>
        <item id="c02" href="09_02.xhtml" media-type="application/xhtml+xml"/>
        <item id="c03" href="10_03.xhtml" media-type="application/xhtml+xml"/>
        <item id="c04" href="11_04.xhtml" media-type="application/xhtml+xml"/>
        <item id="c05" href="12_05.xhtml" media-type="application/xhtml+xml"/>
        <item id="s2" href="13_section2.xhtml" media-type="application/xhtml+xml"/>
        <item id="c06" href="14_06.xhtml" media-type="application/xhtml+xml"/>
        <item id="c07" href="15_07.xhtml" media-type="application/xhtml+xml"/>
        <item id="s3" href="16_section3.xhtml" media-type="application/xhtml+xml"/>
        <item id="c08" href="17_08.xhtml" media-type="application/xhtml+xml"/>
        <item id="c09" href="18_09.xhtml" media-type="application/xhtml+xml"/>
        <item id="author" href="19_author.xhtml" media-type="application/xhtml+xml"/>
        <item id="legal" href="legal.xhtml" media-type="application/xhtml+xml"/>
<!-- -------   THESE 18 LINES   v v v     ------------------------------------>
        <item id="01_titlejpg" href="images/01_title.jpg" media-type="image/jpg" />
        <item id="02jpg" href="images/02.jpg" media-type="image/jpg" />
        <item id="03jpg" href="images/03.jpg" media-type="image/jpg" />
        <item id="04jpg" href="images/04.jpg" media-type="image/jpg" />
        <item id="05jpg" href="images/05.jpg" media-type="image/jpg" />
        <item id="06jpg" href="images/06.jpg" media-type="image/jpg" />
        <item id="06ajpg" href="images/06a.jpg" media-type="image/jpg" />
        <item id="07jpg" href="images/07.jpg" media-type="image/jpg" />
        <item id="08jpg" href="images/08.jpg" media-type="image/jpg" />
        <item id="09jpg" href="images/09.jpg" media-type="image/jpg" />
        <item id="10jpg" href="images/10.jpg" media-type="image/jpg" />
        <item id="11jpg" href="images/11.jpg" media-type="image/jpg" />
        <item id="12jpg" href="images/12.jpg" media-type="image/jpg" />
        <item id="13jpg" href="images/13.jpg" media-type="image/jpg" />
        <item id="14jpg" href="images/14.jpg" media-type="image/jpg" />
        <item id="authorjpg" href="images/author.jpg" media-type="image/jpg" />
        <item id="bccjpg" href="images/bcc.jpg" media-type="image/jpg" />
        <item id="epublogopng" href="images/epublogo.jpg" media-type="image/png" />
<!-- -------   THESE 18 LINES   ^ ^ ^   ------------------------------------>
    </manifest>
    <spine toc="ncx">
        <itemref idref="cover" linear="no"/>
        <itemref idref="titlepage"/>
        <itemref idref="copyright"/>
        <itemref idref="disclaimer"/>
        <itemref idref="dedication"/>
        <itemref idref="toc"/>
        <itemref idref="preface"/>
        <itemref idref="s1"/>
        <itemref idref="c01"/>
        <itemref idref="c02"/>
        <itemref idref="c03"/>
        <itemref idref="c04"/>
        <itemref idref="c05"/>
        <itemref idref="s2"/>
        <itemref idref="c06"/>
        <itemref idref="c07"/>
        <itemref idref="s3"/>
        <itemref idref="c08"/>
        <itemref idref="c09"/>
        <itemref idref="author"/>
        <itemref idref="legal"/>
    </spine>
    <guide>
        <reference href="00_cover.xhtml" type="cover" title="Cover"/>
    </guide>
</package>
2
  • 2
    what toolchain are you using? What method are you using to run epubcheck? Dec 8, 2015 at 23:55
  • Mmm... are you sure that's not "image/jpeg" with an "e"?
    – beaker
    Feb 7, 2016 at 17:10

2 Answers 2

0

It's hard to diagnose without seeing your directory structure and HTML file references, but I think it's a simple file path problem.

First, double check that there are no extra html files or jpgs in the OEBPS directory. It's easy to have extra files or copies of files in there and forget to remove them. This ALWAYS triggers errors from epubcheck.

Second, you need to verify that the image paths in the manifest are the same as the actual directories inside the epub directories. Are these image files at the same level as OEBPS or below OEBPS? (As an additional check, you should open the html files in a browser and make sure all the image files are actually present). In your manifest, the images file would have to be under the OEBPS directory. Here is an example from my manifest of a line referencing images.

 <manifest>
  <item id="d1437e4" href="images-epub/end-whiskey-cropped-notext.jpg"
       media-type="image/jpeg"/>
 </manifest>

I use this directory structure

 OEBPS/
    images-epub/
      end-whiskey-cropped-notext.jpg
    firstxhtml.xhtml
    secondxhtml.xhml
 META-INF/

Doublecheck these things. Other than that, your .opf file looks normal. How are you checking with epubcheck? Is it possible that the error message is a remainder from a previous check?

0

Lesson learned about working from someone else's template.

The 18 lines in question all had this attribute setting:

media-type="image/jpg"

That's how it was written in the template... But this is correct:

media-type="image/jpeg"

Fixing this solved the problem. And surprise surprise, the epub now validates, too.

Here is a great tool that helped me:

https://github.com/IDPF/epubcheck

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.