HEIC in browser

I am not able to see the thumbnail or open the files in the browser.

My Nextcloud config is as follows
Nextcloud 21.0.0
PHP Version: 8.0.3
mysql Version: 8.0.23

ImageMagick is installed with heic support.

here is the output of convert -version

Version: ImageMagick 7.0.11-5 Q16 x86_64 2021-03-20 https://imagemagick.org
Copyright: (C) 1999-2021 ImageMagick Studio LLC
License: ImageMagick - License
Features: Cipher DPC HDRI OpenMP(4.5)
Delegates (built-in): bzlib djvu fontconfig freetype heic jbig jng jpeg lcms lqr lzma openexr pangocairo png tiff webp x xml zlib

PHP imagick plugin is installed as well.

Please use the search function of the forum to find related postings. As far as I remember this problem has already been discussed and solved in the past.


I did use the search function and tried to solve the problem using various previous posts, mostly related to Imagick issues, but I still can not get it work

Can you please post the content of your config.php (please remember to remove sensitive data, before posting it)?

$CONFIG = array (
  'instanceid' => '',
  'passwordsalt' => '',
  'secret' => 'i',
  'trusted_domains' => 
  array (
    0 => '..com',
  'datadirectory' => '/data/olkedata',
  'dbtype' => 'mysql',
  'version' => '',
  'overwrite.cli.url' => 'https://..com',
  'dbname' => '',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '',
  'dbpassword' => '',
  'installed' => true,
  'app_install_overwrite' => 
  array (
    0 => 'occweb',
  'enable_previews' => true,
  'preview_max_x' => 4096,
  'preview_max_y' => 4096,
  'preview_max_filesize_image' => 50,
  'preview_libreoffice_path' => '/usr/bin/libreoffice',
  'preview_office_cl_parameters' => ' --headless --nologo --nofirststartwizard --invisible --norestore --convert-to png --outdir ',
  'enabledPreviewProviders' => 
  array (
    0 => 'OC\\Preview\\PNG',
    1 => 'OC\\Preview\\JPEG',
    2 => 'OC\\Preview\\GIF',
    3 => 'OC\\Preview\\HEIC',
    4 => 'OC\\Preview\\BMP',
    5 => 'OC\\Preview\\XBitmap',
    6 => 'OC\\Preview\\MP3',
    7 => 'OC\\Preview\\TXT',
    8 => 'OC\\Preview\\MarkDown',
    9 => 'OC\\Preview\\OpenDocument',
    10 => 'OC\\Preview\\Krita',
  'default_phone_region' => 'CH',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'mail_smtpmode' => 'smtp',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_sendmailmode' => 'smtp',
  'mail_smtpauth' => 1,
  'maintenance' => false,

Can you please use the following command via SSH and post the output?

# php -r 'phpinfo();' | grep HEIC

Other than that, I would suggest using the Preview Generator App (Preview Generator - Apps - App Store - Nextcloud)

I get an empty output for php -r ‘phpinfo();’ | grep HEIC

I have the preview generator app installed and ran the preview:generate-all -vvv command as well

If the command returns an empty output, it would explain, why the previews are not being generated for the HEIC file type.

Try reinstalling ImageMagick and the corresponding php module as per this guide: 5 minutes to Install Imagemagick with HEIC support on Ubuntu 20.04 (and 18.04) DigitalOcean | Medium


I actually followed the exact same tutorial to install Imagick with HEIC support. Apparently, I can use Imagick to convert images to HEIC using
convert logo: logo.heic
I am using PHP 8.0 so I modified the installation procedure accordingly, probably this might have resulted in some error in configuring php.ini file that the tutorial talks about in step 2.

Thank you for your help @CFelix finally managed to get the preview in the browser.
I had to reinstall the plugin from the master branch of the Imagick repo. Looks like that’s an issue specific to PHP 8.0. Thanks to Building the Imagick PHP extension from master - Freek Van der Herten's blog on PHP, Laravel and JavaScript


Awesome! Remember to mark your post as solution as this might help others with the same problem :+1:


atlast i got it working.
now i can see heic preview as well as full size image
Thanks Manoj @manojknaikade

1 Like

any idea how to get .mov files in browser?
cant play .mov files in browser.
please guide

Off topic here. Please search the forum before opening a new topic.

i havent opened a new topic,
rather a i asked in a topic which relates ios same as heic.

Maybe my answer was to short.
This topic is about HEIC not MOV.

Please open another topic regarding your issue.
Please search the forum for related topics before creating a new topic.

1 Like

Thanks man!

Took me around 45 minutes to get through all those “makes” as my server ain’t no beast, but it’s working fine now. :star_struck:

This topic was automatically closed after 29 days. New replies are no longer allowed.