denshoproject / ddr-cmdln

Command-line tools for automating the Densho Digital Repository's various processes.
Other
0 stars 2 forks source link

Imagemagick refuses to thumbnail PDF files #188

Closed gjost closed 4 years ago

gjost commented 4 years ago

This came up in testing:

E           Exception: identify-im6.q16: attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/408.

/opt/ddr-local/venv/ddrlocal/lib/python3.7/site-packages/ddr_cmdln-3.0.0.post1-py3.7.egg/DDR/imaging.py:100: Exception
--------------------------------------------------------- Captured stdout call ---------------------------------------------------------
/tmp/pytest-of-ddr/test-imaging.jpg
{'path': '/tmp/pytest-of-ddr/test-imaging.jpg', 'format': 'JPEG', 'frames': 1, 'can_thumbnail': None, 'std_out': '/tmp/pytest-of-ddr/test-imaging.jpg JPEG 1024x588 1024x588+0+0 8-bit Gray 256c 123971B 0.000u 0:00.000', 'std_err': '', 'image': True}
/tmp/pytest-of-ddr/test-imaging.pdf
======================================================= short test summary info ========================================================
FAILED ddr/tests/test_imaging.py::test_analyze_magick - Exception: identify-im6.q16: attempt to perform an operation not allowed by t...
============================================= 1 failed, 260 passed, 11 warnings in 16.12s ==============================================

We recently updated our custom Imagemagick policy.xml file (commit b101d59). Recent Debian security fix for Imagemagick: https://security-tracker.debian.org/tracker/DSA-4712-1

GeoffFroh commented 4 years ago

Added "important" label -- this is a major blocking issue.

gjost commented 4 years ago

Included in packages ddrcmdln-master_5.0.7~deb10 and ddrlocal-master_5.0.7~deb10.

Update: This comment was for another issue, please disregard.

gjost commented 4 years ago

Fixed in ddr-cmdln commit 218e3f6. (Note: commit subject was poorly written - it's not PDF thumbnailing that is disabled, it's the disabling of PDF thumbnailing that is disabled. Yes, I know.)

pkikawa commented 4 years ago

tested and working in 5.0.9