Nice write-up but very different to my own method! Assuming you have NextCloud setup already and a pre-existing ImageMagick version working:
1) From jail console, download ImageMagick source somewhere. I like to be in a workspace located in /root/src
Code:
fetch https://download.imagemagick.org/ImageMagick/download/ImageMagick-7.0.11-1.tar.xz
2) extract source
Code:
tar xvfz ImageMagick-7.0.11-1.tar.xz
3)
Code:
cd ImageMagick-7.0.11-1
4) configure
Code:
./configure --with-heic --enable-hdri=no --with-quantum-depth=8
(Note I disable HDRI and use QD 8 for speed. Supposedly QD 16 is a 33% slowdown in image generation. These are thumbnails so I don't think quality is important. Throw in whatever other switches you want. ./configure --help for a full list)
5) compile
Or if you have a multithreaded processor (I have a Ryzen 5 1600 AF which has 12 threads):
6) If make spits back compile errors like it did on mine regarding not knowing how to make certain PC files, you have to copy the files that are missing and weren't generated for some reason, then continue compiling. This should work as a workaround.
Code:
cp MagickCore/MagickCore.pc MagickCore/MagickCore-7.Q8.pc
cp MagickCore/ImageMagick.pc MagickCore/ImageMagick-7.Q8.pc
cp MagickWand/MagickWand.pc MagickWand/MagickWand-7.Q8.pc
cp Magick++/lib/Magick++.pc Magick++/lib/Magick++-7.Q8.pc
make
Note that the correct destination filename to copy to depends on the configure options to choose earlier. If you picked QD 16, it will be Q16 instead. And if you enable HDRI it will have HDRI in the filename. Pay attention to the error you received to figure this out.
7)
8) verify ImageMagick installed and correct formats are listed:
HEIC should be listed now
9) Go back to your workspace and download the php imagick extension source:
Code:
fetch http://pecl.php.net/get/imagick-3.4.4.tgz
10) extract
Code:
tar xvfz imagick-3.4.4.tgz
11)
12) install autoconf which is needed for next step:
Code:
pkg install autoconf
13) prepare php extension source for compiling:
14) configure
15) compile
Or if you have a multithreaded processor (I have a Ryzen 5 1600 AF which has 12 threads):
16) install
17) verify extension is properly installed and being utilized:
Code:
php --ri imagick |less
HEIC should be there now.
18) restart php-fpm
Code:
service php-fpm restart
Something important to remember: if you are using NextCloud as a plugin, upgrading/updating the plugin afterwards will likely completely mess up all your changes because the plugin reinstalls the premade packages. For this reason, I migrated my NextCloud install into a basejail only.