Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the configuration option to ignore the error for missing manifest item referenced by EPUB 2 cover metadata #121

Merged
merged 1 commit into from
Dec 25, 2024

Conversation

vers-one
Copy link
Owner

Add the configuration option to ignore the error for missing manifest item referenced by EPUB 2 cover metadata

This is:

  • a bug fix
  • an enhancement

Related issue: #109

Description

One of most common errors in real-world EPUB 2 books is the situation when the book contains a EPUB 2 cover metadata referencing a non-existing manifest item:

<meta name="cover" content="non-existing-manifest-item-id" />

In such situations, EpubReader was throwing a EpubPackageException with the following message:

Incorrect EPUB manifest: item with ID = "non-existing-manifest-item-id" is missing.

which prevented the app from opening the book.

This pull request adds the BookCoverReaderOptions.Epub2MetadataIgnoreMissingManifestItem property to let the applications ignore this error. This property is set to true when the application is using the EpubReaderOptionsPreset.RELAXED or EpubReaderOptionsPreset.IGNORE_ALL_ERRORS configuration preset or passing null as the epubReaderOptions parameter in one of the EpubReader methods. In all other cases, this property is set to false.

Testing steps

Try to open a EPUB 2 book with the metadata item above.

@vers-one vers-one self-assigned this Dec 25, 2024
@vers-one vers-one merged commit 6162eee into master Dec 25, 2024
4 checks passed
@vers-one vers-one deleted the options branch December 25, 2024 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exception: 'Incorrect EPUB spine: item with IdRef = "cover" is missing in the manifest.'
1 participant