2 "corrupted" / failed imagepreviews

Nextcloud version (eg, 20.0.5): replace
Operating system and version (eg, Ubuntu 20.04): ubuntu-22.04.1-live-server-amd64
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.25
PHP version (eg, 7.4): 8.1.2

The issue you are facing:
2 of the image previews look as if they are corrupted, with a grey bar, I have over a 100 images…

The images are on a SMB share on the NAS, added thru the app “external storage”.
They are very big images (10-30MB - up to 8000x6000 res) however I’ve configured it so it will preview any image of any size, it clearly does work on 95% of the images.

When downloading the images or looking at the SMB the images themselves are fine, rather it is only the preview.

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. have an SMB share connected as “external storage”.
  2. Have ~77 images in it already
  3. Add another ~60

The output of your Nextcloud log in Admin > Logging:

[PHP] Error: Error: getimagesizefromstring(): Error reading from ! at /var/www/nextcloud/lib/private/legacy/OC_Image.php#619 at <<closure>>

 0. <<closure>>
    OC\Log\ErrorHandler::onError()
 1. /var/www/nextcloud/lib/private/legacy/OC_Image.php line 619
    getimagesizefromstring()
 2. /var/www/nextcloud/lib/private/legacy/OC_Image.php line 781
    OC_Image->checkImageDataSize()
 3. /var/www/nextcloud/lib/private/Preview/GeneratorHelper.php line 74
    OC_Image->loadFromData()
 4. /var/www/nextcloud/lib/private/Preview/Generator.php line 205
    OC\Preview\GeneratorHelper->getImage()
 5. /var/www/nextcloud/lib/private/Preview/Generator.php line 114
    OC\Preview\Generator->generatePreviews()
 6. /var/www/nextcloud/lib/private/PreviewManager.php line 185
    OC\Preview\Generator->getPreview()
 7. /var/www/nextcloud/apps/photos/lib/Controller/PreviewController.php line 162
    OC\PreviewManager->getPreview()
 8. /var/www/nextcloud/apps/photos/lib/Controller/PreviewController.php line 128
    OCA\Photos\Controller\PreviewController->fetchPreview()
 9. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 225
    OCA\Photos\Controller\PreviewController->index()
10. /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 133
    OC\AppFramework\Http\Dispatcher->executeController()
11. /var/www/nextcloud/lib/private/AppFramework/App.php line 172
    OC\AppFramework\Http\Dispatcher->dispatch()
12. /var/www/nextcloud/lib/private/Route/Router.php line 298
    OC\AppFramework\App::main()
13. /var/www/nextcloud/lib/base.php line 1047
    OC\Route\Router->match()
14. /var/www/nextcloud/index.php line 36
    OC::handleRequest()

GET /index.php/apps/photos/api/v1/preview/1752?x=64&y=64
from 192.168.1.60 by FoxyHunter at 2022-11-10T15:49:17+00:00

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):


image

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

EMPTY

UPDATE
after deleting, and re-adding the images to the folder, it did perfectly generate the previews for the images, tho I’d still like to know why it happened in the first place, to prevent it from happening again.

I’m seeing the same thing. Specificlally my log is full of:

[PHP] Error: getimagesizefromstring(): Error reading from ! at /var/www/html/nextcloud/apps/photos/lib/Listener/SizeMetadataProvider.php#56
from ? by – at 18 Jan 2024, 10:23:00 pm

But the logging app shows no more detail than that. Does not identify which images are causing this or why. I concur, would be nice to have some feedback here.

How did you know which images to delete and readd?

unfortunatly I never came to know the reason it happened, I just removed and placed there again the 2 images that were broken as a temp fix, and since then it has never ever happened again. I have over 100 000 images now, and never had the issue.

Tomorrow I’ll take a look if I can gather some more information that might help ya. If I do, I’ll put my findings in a reply on your original issue regarding the problem you’re facing.

However, since I also never came to know why it happened to me when it did, I can’t be certain that I’ll be able to help at all.