0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

wsl2-DebianにImageMagickを導入してpdfをpngに変換

Posted at

wsl2上のDebian linux(ver. 11.4)にImageMagickをインストールしました。

動機

pdfをpngにサッと変換したかったのです。

インストール

$ sudo apt list imagemagick
$ sudo apt install imagemagick

あるのを確認してからインストール。versionは6.9.11.60。わたしゃpdf変換できればなんでもOK。

pdf変換で引っかかった

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

検索しますと日本語のページが。

下記のrights="none"rights="read|write"に変更。

/etc/ImageMagick-6/policy.xml(元設定、一部抜粋)
  <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" />
/etc/ImageMagick-6/policy.xml(上記部分、修正後)
  <policy domain="coder" rights="read|write" pattern="PS" />
  <policy domain="coder" rights="read|write" pattern="PS2" />
  <policy domain="coder" rights="read|write" pattern="PS3" />
  <policy domain="coder" rights="read|write" pattern="EPS" />
  <policy domain="coder" rights="read|write" pattern="PDF" />
  <policy domain="coder" rights="read|write" pattern="XPS" />

脆弱性への対処だから、脳死で変更するのも危険なんだけど…。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?