HEIC/MOV previews

Hello,

php -r ‘phpinfo();’ | grep HEIC

convert --version

both two commands are supported, but the heic preview image is not displayed on the browser.
I can’t find out why.

It seems you haven’t read all provided information in detail. Follow the description provided in posting “HEIC/MOV previews” to get the imagemagick support enabled on the console. Once it is supported by the console programs you can enable the php module and the used command will return the expected information :wink:


Thank you very much for your answer.
These two commands have returned the expected information. But the preview still doesn’t appear . And I can’t open the link you gave me because of the region .headache!

Nextcloud’s config.php I changed it, too.as follows:
‘enable_previews’ => true,
‘preview_Movie_path’ => ‘/usr/bin/ffmpeg’,
‘enabledPreviewProviders’ =>
array (
0 => ‘OC\Preview\TXT’,
1 => ‘OC\Preview\MarkDown’,
2 => ‘OC\Preview\OpenDocument’,
3 => ‘OC\Preview\PDF’,
4 => ‘OC\Preview\MSOffice2003’,
5 => ‘OC\Preview\MSOfficeDoc’,
6 => ‘OC\Preview\PDF’,
7 => ‘OC\Preview\Image’,
8 => ‘OC\Preview\Photoshop’,
9 => ‘OC\Preview\HEIC’,
10 => ‘OC\Preview\SVG’,
11 => ‘OC\Preview\Font’,
12 => ‘OC\Preview\MP3’,
13 => ‘OC\Preview\Movie’,
14 => ‘OC\Preview\MKV’,
15 => ‘OC\Preview\MP4’,
16 => ‘OC\Preview\AVI’,
),
But it still doesn’t work , I don 't know what else to set

Is there a better way to provide heic/mov preview?

I have Ubuntu 20.04/nginx and the description under HEIC/MOV previews exaggerated to me. Isn’t there already something better?

Thanks you, I followed your steps more or less and I think this way is simplier.
Worked on Nextcloud v22

Installing dependencies:
sudo apt-get install imagemagick-common php-imagick ffmpeg libmagickcore-dev libde265 libheif

Checking if worked, search for extensions
php -r 'phpinfo();' | grep HEIC

Add setup in config.php
sudo nano /var/www/nextcloud/config/config.php

  'enable_previews' => true,
  'preview_max_x' => 1000,
  'preview_max_y' => 1000,
  'enabledPreviewProviders' => [
    'OC\Preview\TXT',
    'OC\Preview\MarkDown',
    'OC\Preview\PDF',
    'OC\Preview\MSOfficeDoc',
    'OC\Preview\JPEG',
    'OC\Preview\PNG',
    'OC\Preview\GIF',
    'OC\Preview\BMP',
    'OC\Preview\XBitmap',
    'OC\Preview\MP3',
    'OC\Preview\HEIC',
    'OC\Preview\Movie',
    'OC\Preview\MKV',
    'OC\Preview\MP4',
    'OC\Preview\AVI',
  ],

Restart webserver:

sudo systemctl restart apache2
3 Likes

Is there a way to do the same in a docker container? I’ve been trying to SSH into the apache portion of nextcloud aio, but it does not seem to have neither bash nor sh shells available.

Hi,

After following step-by-step instructions from here:

https://eplt.medium.com/5-minutes-to-install-imagemagick-with-heic-support-on-ubuntu-18-04-digitalocean-fe2d09dcef1

and from here:

I did not succeed to have .heic preview in browser.

I still have exactly the same behavior as described by manojknaikade i.e. I get an empty output for php -r ‘phpinfo();’ | grep HEIC.

Also, checking a phpinfo.php via browser, I don’t find HEIC support in the installed imagick module description (capture attached).

One thing to be signaled also: when launching the autogen.sh and configure in the sequence below, I get “No such file” error.

cd /usr/src/libheif/
./autogen.sh
./configure

but the libheif folder does contain some files:

root@cloud:/usr/src/imagick-3.5.1# cd /usr/src/libheif/
root@cloud:/usr/src/libheif# dir
CMakeLists.txt README.md examples gnome logos tests
CMakePresets.json appveyor.yml extra go post.js third-party
COPYING build-emscripten.sh fuzzing libheif pre.js
CPPLINT.cfg cmake gdk-pixbuf libheif.pc.in scripts

root@cloud:/usr/src/libheif# cd /usr/src/libheif/
root@cloud:/usr/src/libheif# ./autogen.sh
-bash: ./autogen.sh: No such file or directory
root@cloud:/usr/src/libheif# ./configure
-bash: ./configure: No such file or directory
root@cloud:/usr/src/libheif#

Could someone guide me from here?

My configuration is:
PHP Version 7.4.3-4 ubuntu2.18
Nextcloud Hub 3 (25.0.7)

I have preview-generator working with other types of images.

Thank you,

For me all the server-side basic stuff was working (like it was quite some time, maybe months or even few years ago). It was disabled by default in a NC release and could be re-enabled in the config.php. HEIC is working again, MOV (HEVC) is not but that’s likely due to a browser problem as it is working in the iOS app.