Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

HEIC preview fails with 512 MiB Imagick limit despite policy.xml override (fixed by newer ImageMagick/libheif)

Abierto
#2,573 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
48/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
docker, php

Línea de trabajo

Comienza reproduciendo el fallo con la prueba directa de PHP Imagick e inspecciona la configuración de ImageMagick de la imagen oficial de Nextcloud Docker, incluido /etc/ImageMagick-7/policy.xml. Compara los paquetes de ImageMagick/libheif incluidos con las versiones más recientes que se probaron. Se considera terminado cuando la imagen actualizada genera vistas previas para el archivo HEIC afectado sin el error de 512 MiB.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

0. Needs triage bug upstream

TL;DR

Current included Imagick can't decode many larger heic due to bug, package update fixes bug.


Description

HEIC images fail to generate previews in the stock Nextcloud Docker image due to an Imagick memory/security limit at exactly 512 MiB. Increasing ImageMagick policy limits and Nextcloud preview limits does not resolve the issue. Upgrading the ImageMagick/libheif stack inside the container immediately fixes the problem.


Steps to reproduce

  1. Deploy official Nextcloud Docker image
  2. Upload HEIC image (modern phone photo, high resolution)
  3. Trigger preview generation (web UI or background jobs)

Actual behavior

Preview generation fails with:

ImagickException:` Memory allocation error:
Security limit exceeded: Allocating 599270415 bytes exceeds the security limit of 536870912 bytes
@ error/heic.c/IsHEIFSuccess/141

Expected behavior

  • ImageMagick should respect configured policy.xml limits
  • HEIC previews should succeed when sufficient memory limits are configured

What was tested

1. Nextcloud config

php 'preview_max_memory' => 1024,

→ No effect

2. ImageMagick policy override

/etc/ImageMagick-7/policy.xml modified:

<policy domain="resource" name="memory" value="1GiB"/>
<policy domain="resource" name="map" value="2GiB"/>
<policy domain="resource" name="disk" value="8GiB"/>
<policy domain="system" name="max-memory-request" value="1GiB"/>

→ Confirmed present inside running container
→ No effect (error still at exactly 536870912 bytes)

3. Direct PHP test (outside Nextcloud)
php -r 'try{
  $im=new Imagick();
  $im->readImage("/path/to/file.heic");
  echo "OK\n";
}catch(Throwable $e){
  echo $e->getMessage(),"\n";
}'

Result: Same 536870912-byte security limit error

→ Confirms issue is not Nextcloud-specific

4. Temporary upgrade inside container

Added newer packages (Debian sid):

apt-get update
apt-get install -y -t sid libheif1 libmagickcore-7.q16-10 libmagickwand-7.q16-10

Then reran same PHP test:

OK

→ Same HEIC file loads successfully


Conclusion

  • The failure is tied to the ImageMagick/libheif version shipped in the container
  • The HEIC decode path appears to ignore or be constrained by a fixed 512 MiB limit in that build
  • Policy changes (max-memory-request, etc.) do not affect this behavior
  • Upgrading the stack resolves the issue immediately

Environment

Nextcloud Docker image (official)
PHP imagick 3.8.1
ImageMagick 7.1.1-43 (container default)
libheif 1.19.8
Debian-based container

After manual upgrade:

  • HEIC decoding works (with minor ABI warning)

Request

  • Update ImageMagick/libheif packages in the base image

Notes

This is reproducible via direct PHP Imagick usage (not specific to Nextcloud)
The error is deterministic and always occurs at 512 MiB allocation threshold
Behavior changes immediately with newer ImageMagick/libheif

Lenguaje dominante
Shell
Estrellas
7.4k
Forks
1.9k
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de nextcloud/docker

Todos los issues de nextcloud/docker

Issues similares

Más issues de Shell/Bash

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.