Nextcloud version (eg, 20.0.5): 23.0.1
Operating system and version (eg, Ubuntu 20.04): 21.10
Apache or nginx version (eg, Apache 2.4.25): Apache
PHP version (eg, 7.4): 8.0.15
Hello,
how do i fix this error, it gets triggered when showing a foto preview.
“OC_Image::fixOrientation(): No image loaded”
Some very big (30MB+) jpg images are not loaded. But they are not corrupted on my synced client.
Hi,
i have exact the same error. Opening large image files not possible and no preview. I also dont use user_usage_report. I also tried installing the previewgenerator App from NC 22, but after reloading, NC23 forces to upgrade the previewgenerator. Hope they will fix it soon.
Hi,
I also have this problem and was able to find a pixel limit for it. The error occurs from an image size of about 33.5 megapixels. Everything up to 6689 x 5016 px works, from 6690 x 5016 px does not work anymore.
I still have Nextcloud instances with version 21.0.7, 22.2.3 and 23.0.0, there this error did not occur yet.
This error is present in versions 21.0.8, 21.0.9, 22.2.4, 22.2.5, 23.0.1 and 23.0.2.
When installing the faulty versions, the HASH error with the file “mimetypelist.js” also always occurred.
I have the same xact problem. All smaller jpegs, let’s say smaller than 8MB have previews and open without error. Problem begins with mages between 8MB - 12MB size. The larger the file, the more often it generates an error. But there is no jpeg file over 12MB with a preview. All bigger than 12MB generate errors. Also logs have a bunch of “Error core OC_Image::fixOrientation(): No image loaded”… Nextcloud Hub II (23.0.2)
Please believe me! It has nothing to do with the file size!
If the image exceeds a certain number of pixels, it is no longer displayed.
Here is a nice example:
3840 x 2160 px (UHD) - the image is displayed
7680 x 4320 px (FUHD) - the picture is displayed
8192 x 4320 px (8K-DCI) - the picture is no longer displayed !?
The images have a size between 30 and 120 kB! Test images
you’re right. The file size is irrelevant. I could reproduce this. The last Image with 8192x4320 px is not previewed and brings the error. Hmm… but how to fix?
On this old thread, there was statet a problem with user_usage_report app, but since i never had and don’t have it installed, i don’t really have a clue where to investigate further how to fix this.
I don’t know a fix, which was of course the motivation posting this problem. I hope some dev can have a closer look into this.
Do we need to open a bug ticket somewhere? What is the process we need to initiate? Or is it enough in the forum here.
Works for me on Nextcloud 23.0.2.
Increase this value. i have tested it with 1280
config/config.php:
* max memory for generating image previews with imagegd (default behavior)
* Reads the image dimensions from the header and assumes 32 bits per pixel.
* If creating the image would allocate more memory, preview generation will
* be disabled and the default mimetype icon is shown. Set to -1 for no limit.
*
* Defaults to ``128`` megabytes
*/
'preview_max_memory' => 128,
'preview_max_memory' => 1280,
But i do not understand it.
Must the software really alloc all the memory?
“preview generation will be disabled”?
I used the small size images posted in zip file above from @Crashandy .
With the parameter ‘preview_max_memory’ => 512, this image is also displayed exactly. The prerequisite is sufficient working memory, which means that these images are not displayed in a hosted Nextcloud. I have an instance with 2 GB of RAM and an image with QUHD also works there.
Now the actually simple solution:
No matter what image content is present, the uncompressed image has a certain size. This size is obviously the basis of the processing in the preview and for the required memory for the display.
So the sufficient parameter for this is: ‘preview_max_memory’ => 512,
After changing to ‘preview_max_memory’ => 512,
Server has crushed almost immediately while generating previews (4GB of memory).
So I have changed to ‘preview_max_memory’ => 256, and server memory to 8GB…
Still crushes but not immediately…
Do I have to tune some memory settings?.. I’m looking something in logs, no findings so far…
I have i high performant setup, with a lot of ram, i am probably not a good reference for you.
My instance runs in docker, i defined a custom php.ini where i adjusted the php memory limit.
I’m not sure if the memory_limit from php is a problem here, but worth a try to adjust the parameter. Depending on your setup, you find a lot of topics in the forum how to adjust this memory limit.
I can jsut tell you that i set the preview value to “-1” and had no crashes, all my high-res-pictures load like a charm now.
The config right there: …/nextcloud/config/config.php.
I had to add the 'preview_max_memory' => 1280 at the end, it was not in my file already.
Do you have a docker installation? Then you can try docker exec -it -u www-data name_of_your_nextcloud_docker_container php occ config:system:set preview_max_memory --value 1280
else if you know how to use occ you can use: occ config:system:set preview_max_memory --value 1280