rousse101 / epubcheck

Automatically exported from code.google.com/p/epubcheck
MIT License
1 stars 0 forks source link

epubcheck does not identify certain errors related to incorrect media-types #303

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago

PROBLEM:

The attached invalid_media_type.epub file fails epubcheck.  Specifically, in 
its content.opf file, the <item> definitions for the .otf fonts have the 
incorrect media-type.  They should be "application/x-font-opentype", but are 
mistakenly defined as "text/css".  As otf files are binary, interpreting them 
as text/css generates hundreds of "is not allowed here" warnings.  For example:

    WARNING: invalid_media_type.epub/OEBPS/Fonts/DejaVuSans-Bold.otf(5): The character 'NEWLINE' is not allowed in 'STRING' expressions
    WARNING: invalid_media_type.epub/OEBPS/Fonts/LinLibertine_Re-4.1.8.otf(5145): Token '@????' not allowed here

There is no clear indication that something is wrong with the media-type.  

METHOD:

(1) To reproduce the problem, run epubcheck on invalid_media_type.epub.  You 
will get a long list of warnings

(2) I also an attached correct_media_type.epub, where the media-type values in 
content.opf have been corrected.  

RESULT:

A long list of "is not allowed here" warnings.

EXPECTED:

It would be ideal if there was an error (or warning) indicating the exact 
source of the problem.  Although we have no interest in using it, the 
FlightCrew utility does give clear errors, including the filename and the line 
number, for example:

    invalid_media_type.epub/OEBPS/content.opf    19    The <item> element's "media-type" attribute has value "text/css", but the file's media type is "application/vnd.ms-opentype".

A message similar to that would be perfect.

Even a more general message would be helpful, something like:  "In content.opf, 
an <item> has a media-type declared as a text mimetype, but is referencing a 
binary file."

PLATFORM:

I am using epubcheck-3.0.1, on both OSX 10.8.5 (dev) and Linux 2.6.18-194.el5 
(prod)

Original issue reported on code.google.com by stickyje...@gmail.com on 10 Sep 2013 at 1:33

Attachments:

GoogleCodeExporter commented 8 years ago
THIS ISSUE MOVED TO GITHUB:
https://github.com/IDPF/epubcheck/issues/

Original comment by rdeltour@gmail.com on 7 Nov 2013 at 10:49