-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
fatal error when an ODT image cannot be fetched #4559
Comments
the file 4559.odt.zip causes the error with pandoc version 2.1.4. to replicate the error rename the file to
The warning is already the topic of issue #4344, while here the main problem is that no output file is produced, while it would be possible to handle the error in order to write the available content |
Maybe @MarLinn can help here. I don't really understand the code in the Odt reader. |
the error is triggered when the ODT reader is used, but i think that it's triggered by my current guess is that the ODT reader leaves an empty file path in the media bag when it fails dereferencing some media contents, and this causes an |
It's probably relevant that in this case "Object 1" is a math formula (mathml), not an image. The ODT reader may be assuming that anything that looks like this refers to an image? |
good point, that could be the cause of the error. anyway the biggest problem here is that the error is fatal to the whole conversion document, so a big document containing a single failing reference like this will get all lost. if the exception is really triggered within |
It's probably worth putting a trace in extractMedia to inspect the
contents of the mediabag when it's run with this odt. Then we'll
understand better what is happening.
Francesco Occhipinti <notifications@github.com> writes:
… good point, that could be the cause of the error. anyway the biggest problem here is that the error is fatal to the whole conversion document, so a big document containing a single failing reference like this will get all lost. if the exception is really triggered within `extractMedia`, it might be worth to make the function more robust by handling the case of empty paths, so that no reader can cause a similar fatal error in the future
--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#4559 (comment)
|
i'm not used to debugging with haskell, thanks for the hint, it can be very through experiments i found out that catching exceptions on the last line of writeMedia would enable us to save the rest of the converted document in similar cases. i also verified that the error is caused by an empty subpath argument passed to writeMedia. we don't want to store malformed paths in the media bag in the first place, and this could be checked into fillMediaBag. this case is more complex because the Odt reader uses insertMedia directly within Readers.Odt.ContentReader, and i think that the empty path is stored there. i think that the warning is shown by so to summarise, catching exceptions at the end of i would close this issue once we manage to save the rest of the document, and open a new one dedicated to improve the conversion of this media element |
if we do not catch these errors, any malformed entry in a media bag could cause the loss of a whole document output. an example of malformed entry is an entry with an empty file path
if we do not catch these errors, any malformed entry in a media bag could cause the loss of a whole document output. an example of malformed entry is an entry with an empty file path
in #4619 i propose a solution to recover the rest of the document when this error happens |
if we do not catch these errors, any malformed entry in a media bag could cause the loss of a whole document output. an example of malformed entry is an entry with an empty file path
if we do not catch these errors, any malformed entry in a media bag could cause the loss of a whole document output. an example of malformed entry is an entry with an empty file path
when an ODT file contains an image that cannot be fetched and the
--extract-media
option is used, a runtime error prevents pandoc from writing any converted output. The following line is printed:The text was updated successfully, but these errors were encountered: