OcttKB/Wiki-OcttKB/tiddlers/Normal/_ImageMagick.tid

29 lines
1.6 KiB
Plaintext

created: 20230117104437158
creator: Octt
modified: 20230724222006518
modifier: Octt
tags: $:/i18n:en
title: ImageMagick
<<^wikipediaframe ImageMagick en>>
!!! ''How to''
* [[Convert pdf to pdf without losing quality|https://stackoverflow.com/questions/49899547/imagemagik-convert-pdf-to-pdf-without-doing-anything#49900085]]
** //you have to upsize and put density first, e.g: `convert -density 288 input.pdf -resize 25% output.pdf`//
* [[Cutting and Bordering|https://www.imagemagick.org/Usage/crop/]]
** [[How to crop an image?|https://superuser.com/questions/1161340/how-to-crop-an-image-using-imagemagick-from-the-command-line#1161341]]
** The most classic crop command is `-crop <Width>x<Height>+<OffsetX>+<OffsetY>`
!!! ''Troubleshooting''
* [[ImageMagick using too much memory to convert PDF files|https://stackoverflow.com/questions/15384879/imagemagick-using-more-than-2gb-of-memory-to-convert-pdf-files]]
** How to limit resources used? [[-limit type value|http://www.imagemagick.org/script/command-line-options.php#limit]]
* [[Error "cache resources exhausted"|https://stackoverflow.com/questions/31407010/cache-resources-exhausted-imagemagick#53699200]]
** [[ImageMagick can come with very low limits|https://github.com/ImageMagick/ImageMagick/issues/396#issuecomment-326849298]], example before and after fix
* [[security policy 'PDF' blocking conversion|https://stackoverflow.com/a/59193253]]
** Edit `/etc/ImageMagick-7/policy.xml` to comment out a line like `<policy domain="coder" rights="none" pattern="PDF" />`, OR edit `rights="[...]"` to `rights="read|write"`