1

I am getting error like this

{"0":"Notice: getimagesize(): Read error! in \/home\/rahul\/public_html\/vendor\/magento\/module-catalog\/Model\/Product\/Image.php on line 890","1":"#0 [internal function]: Magento\\Framework\\App\\ErrorHandler->handler(8, 'getimagesize():...', '\/home\/rahul\/p...', 890, Array)\n#1 \/home\/rahul\/public_html\/vendor\/magento\/module-catalog\/Model\/Product\/Image.php(890): getimagesize('\/home\/rahul\/p...')\n#2 \/home\/rahul\/public_html\/vendor\/magento\/module-catalog\/Helper\/Image.php(552): Magento\\Catalog\\Model\\Product\\Image->getResizedImageInfo()\n#3 \/home\/rahul\/public_html\/vendor\/magento\/module-catalog\/Block\/Product\/ImageBuilder.php(132): Magento\\Catalog\\Helper\\Image->getResizedImageInfo()\n#4 \/home\/rahul\/public_html\/vendor\/magento\/module-catalog\/Block\/Product\/AbstractProduct.php(516): Magento\\Catalog\\Block\\Product\\ImageBuilder->create()\n#5 \/home\/rahul\/public_html\/vendor\/magento\/framework\/Interception\/Interceptor.php(58): Magento\\Catalog\\Block\\Product\\AbstractProduct->getImage(Object(Magento\\Catalog\\Model\\Product\\Interceptor), 'related_product...', Array)\n#6 \/home\/rahul\/public_html\/vendor\/magento\/framework\/Interception\/Interceptor.php(138): Magento\\Catalog\\Block\\Product\\ProductList\\Related\\Interceptor->___callParent('getImage', Array)\n#7 \/home\/rahul\/public_html\/vendor\/magento\/framework\/Interception\/Interceptor.php(153): Magento\\Catalog\\Block\\Product\\ProductList\\Related\\Interceptor->Magento\\Framework\\Interception\\{closure}(Object(Magento\\Catalog\\Model\\Product\\Interceptor), 'related_product...')\n#8 \/home\/rahul\/public_html\/generated\/code\/Magento\/Catalog\/Block\/Product\/ProductList\/Related\/Interceptor.php(351): Magento\\Catalog\\Block\\Product\\ProductList\\Related\\Interceptor->___callPlugins('getImage', Array, Array)\n#9 \/home\/rahul\/public_html\/var\/view_preprocessed\/pub\/static\/app\/design\/frontend\/Sm\/bestshop\/Magento_Catalog\/templates\/product\/list\/related.phtml(1): Magento\\Catalog\\Block\\Product\\ProductList\\Related\\Interceptor->getImage(Object(Magento\\Catalog\\Model\\Product\\Interceptor), 'related_product...')\n#10 \/home\/rahul\/public_html\/vendor\/magento\/framework\/View\/TemplateEngine\/Php.php(59): include('\/home\/rahul\/p...')\n#11 \/home\/rahul\/public_html\/vendor\/magento\/framework\/View\/Element\/Template.php(270): Magento\\Framework\\View\\TemplateEngine\\Php->render(Object(Magento\\Catalog\\Block\\Product\\ProductList\\Related\\Interceptor), '\/home\/rahul\/p...', Array)\n#12 \/home\/rahul\/public_html\/generated\/code\/Magento\/Catalog\/Block\/Product\/ProductList\/Related\/Interceptor.php(440): Magento\\Framework\\View\\Element\\Template->fetchView('\/home\/rahul\/p...')\n#13 \/home\/rahul\/public_html\/vendor\/magento\/framework\/View\/Element\/Template.php(300): Magento\\Catalog\\Block\\Product\\ProductList\\Related\\Interceptor->fetchView('\/home\/rahul\/p...')\n#14 \/home\/rahul\/public_html\/vendor\/magento\/framework\/View\/Element\/AbstractBlock.php(667): Magento\\Framework\\View\\Element\\Template->_toHtml()\n#15 \/home\/rahul\/public_html\/generated\/code\/Magento\/Catalog\/Block\/Product\/ProductList\/Related\/Interceptor.php(765): Magento\\Framework\\View\\Element\\AbstractBlock->toHtml()\n#16 \/home\/rahul\/public_html\/app\/code\/LR\/Catalog\/Controller\/Index\/Custom.php(44): Magento\\Catalog\\Block\\Product\\ProductList\\Related\\Interceptor->toHtml()\n#17 \/home\/rahul\/public_html\/generated\/code\/LR\/Catalog\/Controller\/Index\/Custom\/Interceptor.php(24): LR\\Catalog\\Controller\\Index\\Custom->execute()\n#18 \/home\/rahul\/public_html\/vendor\/magento\/framework\/App\/Action\/Action.php(107): LR\\Catalog\\Controller\\Index\\Custom\\Interceptor->execute()\n#19 \/home\/rahul\/public_html\/vendor\/magento\/framework\/Interception\/Interceptor.php(58): Magento\\Framework\\App\\Action\\Action->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#20 \/home\/rahul\/public_html\/vendor\/magento\/framework\/Interception\/Interceptor.php(138): LR\\Catalog\\Controller\\Index\\Custom\\Interceptor->___callParent('dispatch', Array)\n#21 \/home\/rahul\/public_html\/vendor\/magento\/framework\/Interception\/Interceptor.php(153): LR\\Catalog\\Controller\\Index\\Custom\\Interceptor->Magento\\Framework\\Interception\\{closure}(Object(Magento\\Framework\\App\\Request\\Http))\n#22 \/home\/rahul\/public_html\/generated\/code\/LR\/Catalog\/Controller\/Index\/Custom\/Interceptor.php(39): LR\\Catalog\\Controller\\Index\\Custom\\Interceptor->___callPlugins('dispatch', Array, Array)\n#23 \/home\/rahul\/public_html\/vendor\/magento\/framework\/App\/FrontController.php(55): LR\\Catalog\\Controller\\Index\\Custom\\Interceptor->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#24 \/home\/rahul\/public_html\/vendor\/magento\/framework\/Interception\/Interceptor.php(58): Magento\\Framework\\App\\FrontController->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#25 \/home\/rahul\/public_html\/vendor\/magento\/framework\/Interception\/Interceptor.php(138): Magento\\Framework\\App\\FrontController\\Interceptor->___callParent('dispatch', Array)\n#26 \/home\/rahul\/public_html\/vendor\/magento\/module-store\/App\/FrontController\/Plugin\/RequestPreprocessor.php(94): Magento\\Framework\\App\\FrontController\\Interceptor->Magento\\Framework\\Interception\\{closure}(Object(Magento\\Framework\\App\\Request\\Http))\n#27 \/home\/rahul\/public_html\/vendor\/magento\/framework\/Interception\/Interceptor.php(135): Magento\\Store\\App\\FrontController\\Plugin\\RequestPreprocessor->aroundDispatch(Object(Magento\\Framework\\App\\FrontController\\Interceptor), Object(Closure), Object(Magento\\Framework\\App\\Request\\Http))\n#28 \/home\/rahul\/public_html\/vendor\/magento\/module-page-cache\/Model\/App\/FrontController\/BuiltinPlugin.php(69): Magento\\Framework\\App\\FrontController\\Interceptor->Magento\\Framework\\Interception\\{closure}(Object(Magento\\Framework\\App\\Request\\Http))\n#29 \/home\/rahul\/public_html\/vendor\/magento\/framework\/Interception\/Interceptor.php(135): Magento\\PageCache\\Model\\App\\FrontController\\BuiltinPlugin->aroundDispatch(Object(Magento\\Framework\\App\\FrontController\\Interceptor), Object(Closure), Object(Magento\\Framework\\App\\Request\\Http))\n#30 \/home\/rahul\/public_html\/vendor\/magento\/framework\/Interception\/Interceptor.php(153): Magento\\Framework\\App\\FrontController\\Interceptor->Magento\\Framework\\Interception\\{closure}(Object(Magento\\Framework\\App\\Request\\Http))\n#31 \/home\/rahul\/public_html\/generated\/code\/Magento\/Framework\/App\/FrontController\/Interceptor.php(26): Magento\\Framework\\App\\FrontController\\Interceptor->___callPlugins('dispatch', Array, NULL)\n#32 \/home\/rahul\/public_html\/vendor\/magento\/framework\/App\/Http.php(135): Magento\\Framework\\App\\FrontController\\Interceptor->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#33 \/home\/rahul\/public_html\/generated\/code\/Magento\/Framework\/App\/Http\/Interceptor.php(24): Magento\\Framework\\App\\Http->launch()\n#34 \/home\/rahul\/public_html\/vendor\/magento\/framework\/App\/Bootstrap.php(256): Magento\\Framework\\App\\Http\\Interceptor->launch()\n#35 \/home\/rahul\/public_html\/index.php(62): Magento\\Framework\\App\\Bootstrap->run(Object(Magento\\Framework\\App\\Http\\Interceptor))\n#36 {main}","url":"\/custom\/index\/custom","script_name":"\/index.php"}[email protected]
5
  • Please check file and folder permissions. This is most likely trying to load a file it's not permitted to. Focus on pub/media folder. You can refer to this answer: magento.stackexchange.com/a/95033/44585
    – Zankar
    Commented Nov 6, 2018 at 8:26
  • Thanks @Zankar actually other images are loading properly, for only one category images I am getting this error . So I guess directory permissions are fine , what you suggest ?
    – Mac
    Commented Nov 6, 2018 at 9:35
  • 1
    try figruing out the file causing the error (the category image) and check out that file. It might be corrupted in some way.
    – Zankar
    Commented Nov 6, 2018 at 11:35
  • thanks @Zankar , I will try this and let you know if it works for me or not . thanks
    – Mac
    Commented Nov 6, 2018 at 12:17
  • @Zankar thanks for the tip , it worked for me . can you please post it as a answer so that I can accept it ?
    – Mac
    Commented Nov 12, 2018 at 7:59

2 Answers 2

3

This is very likely due to insufficient permissions on a specific file/folder. You should check file and folder permissions, especially for the pub/media folder. You can refer to this post: https://magento.stackexchange.com/a/95033/44585 You should also try to find the specific file causing the problem so you can investigate the issue quicker.

To fix the file and directory permissions run these commands:

find ./var -type d -exec chmod 777 {} \;
find ./pub/media -type d -exec chmod 777 {} \;
find ./pub/static -type d -exec chmod 777 {} \;
1

You just need to cross check your associated product images, some images must me corrupted or with size 0 bytes. Just go to your directory "/media/catalog/product/" and check images with 0 size.

1
  • in my case - this was the cause. removing the file with a zero size resolved the issue. thank you) Commented Nov 1, 2022 at 9:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.