You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ gs -v
GPL Ghostscript 9.55.0 (2021-09-27)
Copyright (C) 2021 Artifex Software, Inc. All rights reserved.
$ convert --version
Version: ImageMagick 6.9.11-60 Q16 aarch64 2021-01-25 https://imagemagick.org
Copyright: (C) 1999-2021 ImageMagick Studio LLC
Bug
I have a pdf image, fig1_galilean_spacetime.pdf (in 2023 issue 02 article 02) that I need to convert to SVG. I could do so with ImageMagick (convert). But I get an error:
$ convert -density 300 -units PixelsPerInch fig1_galilean_spacetime.pdf -quality 90 fig1_galilean_spacetime.svg
convert-im6.q16: attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/421.
(Note: there's an even neater way to convert. The TeX file has the class \documentclass[tikz,convert={outfile=\jobname.svg}]{standalone}. Running pdflatex -shell-escape fig1_galilean_spacetime.texautomatically runsconvert` with suitable parameters. But we get the error above.)
Explanation
As the discussion linked above explains, there was a security flaw in Ghostscript <= 9.24. Imagemagick uses Ghostscript to convert PDF files, and the security flaw would allow code embedded in PDF files to execute stuff on a computer. Imagemagick introduced a default policy to not convert PDF files, until Ghostscript was fixed.
Newer versions of Imagemagick don't appear to have the issue: when I run the conversion command on my system (rather than docker), it works. On my system, the versions are ImageMagick 7.1.1-26 and Ghostscript 10.02.1 (included in MacTeX, or perhaps I installed ImageMagick separately with Homebrew).
Otherwise, there's a temporary fix involving modifying Imagemagick's config file. It's explained in the Stackoverflow post above. But it'd be erased with updates, so it's safer to simply update the software at some point.
The text was updated successfully, but these errors were encountered:
Not urgent.
I encountered the following bug: https://stackoverflow.com/questions/52998331/imagemagick-security-policy-pdf-blocking-conversion. Long story short, it would probably disappear if the repo used newer versions of Ghostscript / Imagemagick, more specifically, ImageMagick 7. Currently, the versions are from 2021:
Bug
I have a pdf image,
fig1_galilean_spacetime.pdf
(in 2023 issue 02 article 02) that I need to convert to SVG. I could do so with ImageMagick (convert
). But I get an error:$ convert -density 300 -units PixelsPerInch fig1_galilean_spacetime.pdf -quality 90 fig1_galilean_spacetime.svg convert-im6.q16: attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/421.
(Note: there's an even neater way to convert. The TeX file has the class
\documentclass[tikz,convert={outfile=\jobname.svg}]{standalone}
. Running pdflatex -shell-escape fig1_galilean_spacetime.texautomatically runs
convert` with suitable parameters. But we get the error above.)Explanation
As the discussion linked above explains, there was a security flaw in Ghostscript <= 9.24. Imagemagick uses Ghostscript to convert PDF files, and the security flaw would allow code embedded in PDF files to execute stuff on a computer. Imagemagick introduced a default policy to not convert PDF files, until Ghostscript was fixed.
Newer versions of Imagemagick don't appear to have the issue: when I run the conversion command on my system (rather than docker), it works. On my system, the versions are ImageMagick 7.1.1-26 and Ghostscript 10.02.1 (included in MacTeX, or perhaps I installed ImageMagick separately with Homebrew).
Otherwise, there's a temporary fix involving modifying Imagemagick's config file. It's explained in the Stackoverflow post above. But it'd be erased with updates, so it's safer to simply update the software at some point.
The text was updated successfully, but these errors were encountered: