I’ve compiled from code latest ImageMagic with heic support and module is enabled and working on the PHP side. But, as soon as i access the heic file an exception is thown giving not much details other than it was unable to set image format…
I’m attaching the debug trace of that exception:
{
"reqId": "vqjXxuUSwb5VqYCdA9e4",
"level": 3,
"time": "2021-10-10T11:06:58+00:00",
"remoteAddr": "192.168.100.21",
"user": "korisnik",
"app": "core",
"method": "GET",
"url": "/core/preview?fileId=460464&x=256&y=256&a=true&v="33ae594fa019d93641f208facc97d8b1"",
"message": "File: /korisnik/files/Iphone Media (autobackup)/20200816 134424 6329.heic Imagick says: Unable to set image format",
"userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36",
"version": "22.2.0.2",
"exception": {
"Exception": "ImagickException",
"Message": "Unable to set image format",
"Code": 1,
"Trace": [
{
"file": "/home/nextcloud/www/versions/nextcloud-22.2.0/lib/private/Preview/HEIC.php",
"line": 106,
"function": "setImageFormat",
"class": "Imagick",
"type": "->"
},
{
"file": "/home/nextcloud/www/versions/nextcloud-22.2.0/lib/private/Preview/HEIC.php",
"line": 64,
"function": "getResizedPreview",
"class": "OC\\Preview\\HEIC",
"type": "->"
},
{
"file": "/home/nextcloud/www/versions/nextcloud-22.2.0/lib/private/Preview/GeneratorHelper.php",
"line": 62,
"function": "getThumbnail",
"class": "OC\\Preview\\HEIC",
"type": "->"
},
{
"file": "/home/nextcloud/www/versions/nextcloud-22.2.0/lib/private/Preview/Generator.php",
"line": 245,
"function": "getThumbnail",
"class": "OC\\Preview\\GeneratorHelper",
"type": "->"
},
{
"file": "/home/nextcloud/www/versions/nextcloud-22.2.0/lib/private/Preview/Generator.php",
"line": 140,
"function": "getMaxPreview",
"class": "OC\\Preview\\Generator",
"type": "->"
},
{
"file": "/home/nextcloud/www/versions/nextcloud-22.2.0/lib/private/Preview/Generator.php",
"line": 109,
"function": "generatePreviews",
"class": "OC\\Preview\\Generator",
"type": "->"
},
{
"file": "/home/nextcloud/www/versions/nextcloud-22.2.0/lib/private/PreviewManager.php",
"line": 189,
"function": "getPreview",
"class": "OC\\Preview\\Generator",
"type": "->"
},
{
"file": "/home/nextcloud/www/versions/nextcloud-22.2.0/core/Controller/PreviewController.php",
"line": 169,
"function": "getPreview",
"class": "OC\\PreviewManager",
"type": "->"
},
{
"file": "/home/nextcloud/www/versions/nextcloud-22.2.0/core/Controller/PreviewController.php",
"line": 142,
"function": "fetchPreview",
"class": "OC\\Core\\Controller\\PreviewController",
"type": "->"
},
{
"file": "/home/nextcloud/www/versions/nextcloud-22.2.0/lib/private/AppFramework/Http/Dispatcher.php",
"line": 217,
"function": "getPreviewByFileId",
"class": "OC\\Core\\Controller\\PreviewController",
"type": "->"
},
{
"file": "/home/nextcloud/www/versions/nextcloud-22.2.0/lib/private/AppFramework/Http/Dispatcher.php",
"line": 126,
"function": "executeController",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->"
},
{
"file": "/home/nextcloud/www/versions/nextcloud-22.2.0/lib/private/AppFramework/App.php",
"line": 156,
"function": "dispatch",
"class": "OC\\AppFramework\\Http\\Dispatcher",
"type": "->"
},
{
"file": "/home/nextcloud/www/versions/nextcloud-22.2.0/lib/private/Route/Router.php",
"line": 301,
"function": "main",
"class": "OC\\AppFramework\\App",
"type": "::"
},
{
"file": "/home/nextcloud/www/versions/nextcloud-22.2.0/lib/base.php",
"line": 1000,
"function": "match",
"class": "OC\\Route\\Router",
"type": "->"
},
{
"file": "/home/nextcloud/www/versions/nextcloud-22.2.0/index.php",
"line": 36,
"function": "handleRequest",
"class": "OC",
"type": "::"
}
],
"File": "/home/nextcloud/www/versions/nextcloud-22.2.0/lib/private/Preview/HEIC.php",
"Line": 106,
"CustomMessage": "File: /korisnik/files/Iphone Media (autobackup)/20200816 134424 6329.heic Imagick says: Unable to set image format"
}
}
Nextcloud version: 22.2.0
OS: Ubuntu 20.04 / Nginx
PHP version: 8.0
ImageMagic 7 with HEIC support