freedomofpress / dangerzone

Take potentially dangerous PDFs, office documents, or images and convert them to safe PDFs
https://dangerzone.rocks/
GNU Affero General Public License v3.0
3.75k stars 172 forks source link

tests: Add a doc with multimedia elements #966

Closed apyrgio closed 1 month ago

apyrgio commented 1 month ago

Add a doc that contains an MP4 video in it, which has an audio and video stream. This type of document could not be converted with the latest Dangerzone releases, because PyMuPDF threw this error in the container's stdout:

MuPDF error: unsupported error: cannot create appearance stream for
Screen annotations

This error message was treated literally by our client code, which parsed the first few bytes in order to find out the page height/width. This resulted to a misleading Dangerzone error, e.g.:

A page exceeded the maximum height

This issue started occurring since 0.6.0, which added streaming support, and was fixed by commit 3f86e7b4654e0aea458b54248288eb9e2b1e86f8. That fix was not accompanied by a test document that would ensure we would not have this regression from now on, so we add it in this commit.

Refs #877 Closes #917