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

not authorized for pdfs #7

Open
Kreijstal opened this issue Jan 3, 2024 · 2 comments
Open

not authorized for pdfs #7

Kreijstal opened this issue Jan 3, 2024 · 2 comments

Comments

@Kreijstal
Copy link

07:56:48 pi@juanraspberry test → sudo vv abschlussffb7a237-d6e4-4c04-92c1-8dbab8158ee3.pdf
abschlussffb7a237-d6e4-4c04-92c1-8dbab8158ee3.pdf 6 pages, 589.606 x 841.889 pts
convert-im6.q16: attempt to perform an operation not allowed by the security policy PDF' @ error/constitute.c/IsCoderAuthorized/421. convert-im6.q16: no images defined sixel:-' @ error/convert.c/ConvertImageCommand/3229.
07:57:50 pi@juanraspberry test →

@hackerb9
Copy link
Owner

hackerb9 commented Jan 3, 2024

Thank you for the report! I have not tested vv on pdfs so it is good to hear from someone who is trying it. The problem appears to be that some installations of ImageMagick do not allow converting pdfs by default.

It is possible to work around it by editing the file /etc/ImageMagick-6/policy.xml and commenting out the policy lines that prevent ghostscript from being called. (This may be a security problem if ImageMagick is being used as a service on a webserver).

...
  <!-- disable ghostscript format types -->
  <!-- <policy domain="coder" rights="none" pattern="PS" /> -->
  <!-- <policy domain="coder" rights="none" pattern="PS2" /> -->
  <!-- <policy domain="coder" rights="none" pattern="PS3" /> -->
  <!-- <policy domain="coder" rights="none" pattern="EPS" /> -->
  <!-- <policy domain="coder" rights="none" pattern="PDF" /> -->
  <!-- <policy domain="coder" rights="none" pattern="XPS" /> -->
</policymap>

It looks like Debian 10 (Bullseye) and 11 (Buster) require this workaround. From my testing, it appears the problem does not exist in the upcoming release of Debian GNU/Linux 13 (Trixie). I am not sure, but probably Debian 12 (Bookworm) is fine which is good since it is the current stable release.

By the way, would you want vv to offer to show all the pages of a PDF, similar to how it handles recursively entering a directory?

@Kreijstal
Copy link
Author

Kreijstal commented Jan 3, 2024

By the way, would you want vv to offer to show all the pages of a PDF, similar to how it handles recursively entering a directory?

👀
Wow! TOP answer!
Thank you so much for the effort and quick response! That would make vv a sixel pdf viewer, yes of course! :D

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

No branches or pull requests

2 participants