Answers.Body: <p>Lesson learned about working from someone else's template.</p>
  
  <p>The 18 lines in question all had this attribute setting:</p>
  
  <pre><code>media-type="image/jpg"
  </code></pre>
  
  <p>That's how it was written in the template... But this is correct:</p>
  
  <pre><code>media-type="image/jpeg"
  </code></pre>
  
  <p>Fixing this solved the problem. And surprise surprise, the epub now validates, too.</p>
  
  <p>Here is a great tool that helped me:</p>
  
  <p><a href="https://github.com/IDPF/epubcheck" rel="nofollow">https://github.com/IDPF/epubcheck</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-15T23:58:01.647Z
Answers.LastActivityDate: 2016-03-15T23:58:01.647Z
Answers.UserDisplayName: crashwap
Answers.Body: <p>It's hard to diagnose without seeing your directory structure and HTML file references, but  I think it's a simple file path problem.  </p>
  
  <p>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. </p>
  
  <p>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. </p>
  
  <pre><code> &lt;manifest&gt;
    &lt;item id="d1437e4" href="images-epub/end-whiskey-cropped-notext.jpg"
         media-type="image/jpeg"/&gt;
   &lt;/manifest&gt;
  </code></pre>
  
  <p>I use this directory structure</p>
  
  <pre><code> OEBPS/
      images-epub/
        end-whiskey-cropped-notext.jpg
      firstxhtml.xhtml
      secondxhtml.xhml
   META-INF/
  </code></pre>
  
  <p>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? </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-08T23:50:49.250Z
Answers.LastActivityDate: 2015-12-09T00:11:32.260Z
Answers.LastEditDate: 2015-12-09T00:11:32.260Z
Answers.UserDisplayName: idiotprogrammer
Body: <p>My epub document has the following errors (one for each of the 18 images in the epub):</p>
  
  <p><code>ERROR(RSC-008): story.epub/OEBPS/09_02.xhtml(25,83): Referenced resource is not declared in the OPF manifest.</code></p>
  
  <p><code>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.</code></p>
  
  <p><strong><em>Why <code>story.epub/story.epub(-1,-1)</code> in the 2nd error? But, continuing on...</em></strong></p>
  
  <p>Fair enough. So I added them to the <code>opf</code> document, under the <code>&lt;manifest&gt;</code> section (see below) but did not include them in the <code>&lt;spine&gt;</code> section.</p>
  
  <p>The images all disappeared from the EPUB file.  </p>
  
  <p>So, I removed those 18 lines and ... everything came back again.</p>
  
  <p>Pour-qu'why?</p>
  
  <p>EPUBZone's <a href="http://epubzone.org/news/epub-3-packaging-and-metadata#_meta_meta_element" rel="nofollow">EPUB 3 Packaging and Metadata</a> document says:</p>
  
  <blockquote>
    <p>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.</p>
  </blockquote>
  
  <p>and</p>
  
  <blockquote>
    <p>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).</p>
  </blockquote>
  
  <p>I've scoured the <a href="http://www.idpf.org/epub/20/spec/OPF_2.0.1_draft.htm#Section2.2.1" rel="nofollow">IDPF spec document</a> and cannot find the solution for myself. A little help, svp?</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;package xmlns="http://www.idpf.org/2007/opf" version="2.0" unique-identifier="BookId"&gt;
      &lt;metadata   xmlns:dc="http://purl.org/dc/elements/1.1/"
                  xmlns:opf="http://www.idpf.org/2007/opf"&gt;
  
          &lt;dc:title&gt;The Book That I Wrote&lt;/dc:title&gt; 
          &lt;dc:identifier id="BookId"&gt;urn:uuid:llasjdflasf&lt;/dc:identifier&gt;
          &lt;dc:source&gt;MyBookByMe&lt;/dc:source&gt;
          &lt;dc:date&gt;2015&lt;/dc:date&gt;
          &lt;dc:rights&gt;Copyright 2015 Me Myself I&lt;/dc:rights&gt; 
          &lt;dc:description&gt;Autobiography&lt;/dc:description&gt;
  
          &lt;dc:creator opf:role="aut"&gt;Me Myself I&lt;/dc:creator&gt;
          &lt;dc:language&gt;en&lt;/dc:language&gt; 
          &lt;dc:subject&gt;Biography&lt;/dc:subject&gt;
          &lt;dc:subject&gt;AutoBiography&lt;/dc:subject&gt;
          &lt;dc:subject&gt;Humour&lt;/dc:subject&gt;
          &lt;dc:publisher&gt;Self&lt;/dc:publisher&gt;
          &lt;meta name="cover" content="cover-image" /&gt;
      &lt;/metadata&gt;
      &lt;manifest&gt;
          &lt;item id="ncx" href="toc.ncx" media-type="application/x-dtbncx+xml"/&gt;
          &lt;item id="style" href="stylesheet.css" media-type="text/css"/&gt;
          &lt;item id="pagetemplate" href="page-template.xpgt" media-type="application/vnd.adobe-page-template+xml"/&gt;
          &lt;item id="cover" href="00_cover.xhtml" media-type="application/xhtml+xml"/&gt;
          &lt;item id="cover-image" href="images/00_cover.jpg" media-type="image/jpeg"/&gt;
          &lt;item id="titlepage" href="01_title.xhtml" media-type="application/xhtml+xml"/&gt;
          &lt;item id="copyright" href="02_copyright.xhtml" media-type="application/xhtml+xml"/&gt;
          &lt;item id="disclaimer" href="03_disclaimer.xhtml" media-type="application/xhtml+xml"/&gt;
          &lt;item id="dedication" href="04_dedication.xhtml" media-type="application/xhtml+xml"/&gt;
          &lt;item id="toc" href="05_toc.xhtml" media-type="application/xhtml+xml"/&gt;
          &lt;item id="preface" href="06_preface.xhtml" media-type="application/xhtml+xml"/&gt;
          &lt;item id="s1" href="07_section1.xhtml" media-type="application/xhtml+xml"/&gt;
          &lt;item id="c01" href="08_01.xhtml" media-type="application/xhtml+xml"/&gt;
          &lt;item id="c02" href="09_02.xhtml" media-type="application/xhtml+xml"/&gt;
          &lt;item id="c03" href="10_03.xhtml" media-type="application/xhtml+xml"/&gt;
          &lt;item id="c04" href="11_04.xhtml" media-type="application/xhtml+xml"/&gt;
          &lt;item id="c05" href="12_05.xhtml" media-type="application/xhtml+xml"/&gt;
          &lt;item id="s2" href="13_section2.xhtml" media-type="application/xhtml+xml"/&gt;
          &lt;item id="c06" href="14_06.xhtml" media-type="application/xhtml+xml"/&gt;
          &lt;item id="c07" href="15_07.xhtml" media-type="application/xhtml+xml"/&gt;
          &lt;item id="s3" href="16_section3.xhtml" media-type="application/xhtml+xml"/&gt;
          &lt;item id="c08" href="17_08.xhtml" media-type="application/xhtml+xml"/&gt;
          &lt;item id="c09" href="18_09.xhtml" media-type="application/xhtml+xml"/&gt;
          &lt;item id="author" href="19_author.xhtml" media-type="application/xhtml+xml"/&gt;
          &lt;item id="legal" href="legal.xhtml" media-type="application/xhtml+xml"/&gt;
  &lt;!-- -------   THESE 18 LINES   v v v     ------------------------------------&gt;
          &lt;item id="01_titlejpg" href="images/01_title.jpg" media-type="image/jpg" /&gt;
          &lt;item id="02jpg" href="images/02.jpg" media-type="image/jpg" /&gt;
          &lt;item id="03jpg" href="images/03.jpg" media-type="image/jpg" /&gt;
          &lt;item id="04jpg" href="images/04.jpg" media-type="image/jpg" /&gt;
          &lt;item id="05jpg" href="images/05.jpg" media-type="image/jpg" /&gt;
          &lt;item id="06jpg" href="images/06.jpg" media-type="image/jpg" /&gt;
          &lt;item id="06ajpg" href="images/06a.jpg" media-type="image/jpg" /&gt;
          &lt;item id="07jpg" href="images/07.jpg" media-type="image/jpg" /&gt;
          &lt;item id="08jpg" href="images/08.jpg" media-type="image/jpg" /&gt;
          &lt;item id="09jpg" href="images/09.jpg" media-type="image/jpg" /&gt;
          &lt;item id="10jpg" href="images/10.jpg" media-type="image/jpg" /&gt;
          &lt;item id="11jpg" href="images/11.jpg" media-type="image/jpg" /&gt;
          &lt;item id="12jpg" href="images/12.jpg" media-type="image/jpg" /&gt;
          &lt;item id="13jpg" href="images/13.jpg" media-type="image/jpg" /&gt;
          &lt;item id="14jpg" href="images/14.jpg" media-type="image/jpg" /&gt;
          &lt;item id="authorjpg" href="images/author.jpg" media-type="image/jpg" /&gt;
          &lt;item id="bccjpg" href="images/bcc.jpg" media-type="image/jpg" /&gt;
          &lt;item id="epublogopng" href="images/epublogo.jpg" media-type="image/png" /&gt;
  &lt;!-- -------   THESE 18 LINES   ^ ^ ^   ------------------------------------&gt;
      &lt;/manifest&gt;
      &lt;spine toc="ncx"&gt;
          &lt;itemref idref="cover" linear="no"/&gt;
          &lt;itemref idref="titlepage"/&gt;
          &lt;itemref idref="copyright"/&gt;
          &lt;itemref idref="disclaimer"/&gt;
          &lt;itemref idref="dedication"/&gt;
          &lt;itemref idref="toc"/&gt;
          &lt;itemref idref="preface"/&gt;
          &lt;itemref idref="s1"/&gt;
          &lt;itemref idref="c01"/&gt;
          &lt;itemref idref="c02"/&gt;
          &lt;itemref idref="c03"/&gt;
          &lt;itemref idref="c04"/&gt;
          &lt;itemref idref="c05"/&gt;
          &lt;itemref idref="s2"/&gt;
          &lt;itemref idref="c06"/&gt;
          &lt;itemref idref="c07"/&gt;
          &lt;itemref idref="s3"/&gt;
          &lt;itemref idref="c08"/&gt;
          &lt;itemref idref="c09"/&gt;
          &lt;itemref idref="author"/&gt;
          &lt;itemref idref="legal"/&gt;
      &lt;/spine&gt;
      &lt;guide&gt;
          &lt;reference href="00_cover.xhtml" type="cover" title="Cover"/&gt;
      &lt;/guide&gt;
  &lt;/package&gt;
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-12-08T23:55:25.760Z
Comments.Text: what toolchain are you using? What method are you using to run epubcheck?
Comments.UserDisplayName: idiotprogrammer
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-02-07T17:10:52.947Z
Comments.Text: Mmm... are you sure that's not `"image/jpeg"` with an "e"?
Comments.UserDisplayName: beaker
Tags: <epub><validation>
Title: Adding images to manifest made them disappear from epub
UserDisplayName: crashwap
ThreadText: # Adding images to manifest made them disappear from epub
  
  (Asked by: username_0 on 2015-12-08)
  
  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  section (see below) but did not include them in the  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?
  
  
      
  
          The Book That I Wrote 
          urn:uuid:llasjdflasf
          MyBookByMe
          2015
          Copyright 2015 Me Myself I 
          Autobiography
  
          Me Myself I
          en 
          Biography
          AutoBiography
          Humour
          Self
  
  **Tags:** epub, validation
  
  > **Comments:**
  > **username_1**: what toolchain are you using? What method are you using to run epubcheck?  
  > **username_2**: Mmm... are you sure that's not `"image/jpeg"` with an "e"?  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2016-03-15. Score: 0 | Accepted answer
  
  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
  
  
  ---
  
  ### Answer by username_1 on 2015-12-08. Score: 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. 
   
    
   
  
  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?
  
  
  ---
  
  