You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Image dimensions are checked without loading the entire image into memory.
Actual behaviour
Even though the image is not eligible for preview generation, a large amount of memory is consumed. On my instance hosted on a single-board computer, this triggers an oom-kill:
Setting preview_max_filesize_image to a low value is not a solution, because image compression may reduce unreasonably large images to a normal size.
As far as I can tell, this behavior is caused by
being called before dimensions are checked. Instead, something like getimagesize() should be used, which is able to check image dimensions without decoding the entire image.
[Wed Dec 18 00:00:03.116344 2024] [mpm_prefork:notice] [pid 513:tid 513] AH00163: Apache/2.4.62 (Debian) configured -- resuming normal operations
[Wed Dec 18 00:00:03.116467 2024] [core:notice] [pid 513:tid 513] AH00094: Command line: '/usr/sbin/apache2'
Dec 18 11:00:30 owncloud systemd[1]: apache2.service: A process of this unit has been killed by the OOM killer.
Network log:
(502) https://owncloud.sphinx-universe.ts.net/remote.php/dav/files/root/test.png?c=2c2e79474df52430273afd9872207586&x=31&y=31&forceIcon=0&preview=1 (no content)
Console only shows the failed preview request.
The text was updated successfully, but these errors were encountered:
Steps to reproduce
'preview_max_dimensions' => '1000x1000'
test.png
, even though both exceed the maximum dimensions and neither preview is actually generated.Attachments
test.png
test2.png
Expected behaviour
Image dimensions are checked without loading the entire image into memory.
Actual behaviour
Even though the image is not eligible for preview generation, a large amount of memory is consumed. On my instance hosted on a single-board computer, this triggers an oom-kill:
dmesg excerpt
Setting
preview_max_filesize_image
to a low value is not a solution, because image compression may reduce unreasonably large images to a normal size.As far as I can tell, this behavior is caused by
core/lib/private/Preview/Image.php
Line 47 in 0401d6a
Server configuration
Operating system:
Debian Bookworm 12.8
Kernel 6.1.115-1 (x86_64)
Web server:
apache2 2.4.62-1~deb12u2
Database:
mariadb 1:10.11.6-0+deb12u1
PHP version:
libapache2-mod-php7.4 1:7.4.33-15+0~20240927.95+debian12~1.gbp1b3cac
ownCloud version: (see ownCloud admin page)
10.15.0.2
Updated from an older ownCloud or fresh install:
Updated from an older version using the manual process
Where did you install ownCloud from:
Tarball obtained from owncloud.com
Signing status (ownCloud 9.0 and above):
The content of config/config.php:
config report
List of activated apps:
app:list output
Are you using external storage, if yes which one: no
Are you using encryption: no
Are you using an external user-backend, if yes which one: none
Client configuration
Browser:
Firefox 132.0.1
Operating system:
MX-23.4 / Xfce 4.18.1 / Debian Bookworm 12.8
Logs
Web server error log
ownCloud log (data/owncloud.log)
Log entries from the relevant timeframe
Browser log
The text was updated successfully, but these errors were encountered: