HEIC preview fails with 512 MiB Imagick limit despite policy.xml override (fixed by newer ImageMagick/libheif)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- docker, php
- Lĩnh vực
- devops, infrastructure
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện lỗi với bài kiểm tra PHP Imagick trực tiếp và kiểm tra thiết lập ImageMagick của image Docker Nextcloud chính thức, bao gồm /etc/ImageMagick-7/policy.xml. So sánh các gói ImageMagick/libheif được cung cấp với các phiên bản mới hơn đã được kiểm thử. Hoàn thành khi image đã cập nhật tạo được bản xem trước cho tệp HEIC bị ảnh hưởng mà không gặp lỗi 512 MiB.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Deploy official Nextcloud Docker image
- Upload HEIC image (modern phone photo, high resolution)
- 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
- Ngôn ngữ chính
- Shell
- Star
- 7.4k
- Fork
- 1.9k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của nextcloud/docker
-
1. To develop bug feature: cron image
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Drop paragarph about anonymous (unnamed) volumes under Persistent Storage section fo the docsĐang mởbug docs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
-
0. Needs triage bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
Imagick architecture mismatch (x86_64 vs aarch64) on official arm64 image causes Apache segfaultsĐang mở0. Needs triage bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 50/100
Tất cả issue của nextcloud/docker
Issue tương tự
-
Add .gitignoreCó thể đã có người làm @ajeanmahoney đã nhận hôm nay. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
tesseract-ocr/tesseract#4653 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
complexity::1-low effort::1-hours priority::1-must
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
jumpingrivers/audit.workbench#36 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:install bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Duplicate CFBundleIdentifier in copied _Testing_* overlay frameworks breaks simulator installĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
johnno1962/InjectionNext#175 · 2 bình luận ·