This commit is contained in:
nodlek-ctrl 2023-04-12 17:43:24 +10:00
parent 08a67f7b5a
commit b56c4dad1c
2 changed files with 14 additions and 0 deletions

View File

@ -82,6 +82,18 @@ On Arch Linux based distros you may install `bluez` first, as it may not be inst
sudo pacman -S bluez bluez-utils
```
You may or may not need to install ImageMagick and Ghostscript, depending on your distro.
```bash
sudo apt install imagemagick ghostscript
```
Or the package manager of your distro.
Extra configuration is required for ImageMagick to work. Because IM is made for external webserver, a strict security policy is applied. You need to add the following line to `/etc/ImageMagick-6/policy.xml` before `</policymap>`:
```xml
<policy domain="coder" rights="read | write" pattern="PDM" />
```
Because this script is only accesible by localhost, or at most your local network, this is safe.
*Packaging is also on the way!*
### MacOS

View File

@ -567,6 +567,8 @@ def fallback_program(*programs):
return None
_MagickExe = fallback_program('magick', 'magick.exe', 'convert', 'convert.exe')
if _MagickExe is None:
error('ImageMagic not found. Please install and configure as per readme.')
def magick_text(stdin, image_width, font_size, font_family):
'Pipe an io to ImageMagick for processing text to image, return output io'