We have a bit of a frustrating issue.
When we run command php bin/magento catalog:image:resize it will do exactly 5287 lines from table catalog_product_entity_media_gallery
So we made sure images are there, not too big, etc. Then we deleted the image that gave the error from the table catalog_product_entity_media_gallery so it can not cause more issue.
Rerun php bin/magento catalog:image:resize and exactly same error with the 5287 lines and error on next product...
After that throws error
imagecreatfromjpeg: gd-jpeg: unrecoverable error. Unsupported marker type 0xdf in public_html/vendor/magento/framework/Image/Adapter/Gd2.php on line 72.
So on line 72 is this
$this->_fileName
It is part of:
$this->imageDestroy();
$this->_imageHandler = call_user_func(
$this->_getCallback('create', null, sprintf('Unsupported image format. File: %s', $this->_fileName)),
$this->_fileName
);
We are on fast VPS with 16gb so memory should not be it, we have enough disk space. All rights are good, all images are there...
You advice is appreciated.
So, my own stupid mistake. We imported prodcuts with help of emagic tool. A bunch of products was imported but was not 'active' and not 'inactive'. After putting active, removing those from table and add image to the products again the command could continue. Sorry if I wasted somebodies time.
Another solution I found this moment with same problem, is to search in database-table "catalog_product_entity_media_gallery" for the image-path as value, for example "L/O/LOT_850_133_2021-07-17-4870.jpg". If you find an entry, you change the field "disabled" to "1" and it ignores the image.
Only a fast solution, if the image not important or you want it later manually add by backend.