1

I am using Magento v2.2.5 and I am getting error on product detail page.

1 exception(s):
Exception #0 (Exception): Unsupported image format.

Exception #0 (Exception): Unsupported image format.
#0 /html/vendor/magento/framework/Image/Adapter/Gd2.php(68): Magento\Framework\Image\Adapter\Gd2->_getCallback('create')
#1 /html/vendor/magento/framework/Image.php(55): Magento\Framework\Image\Adapter\Gd2->open('/home/ma...')
#2 /html/vendor/magento/framework/Image.php(36): Magento\Framework\Image->open()
#3 /html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(111): Magento\Framework\Image->__construct(Object(Magento\Framework\Image\Adapter\Gd2), '/home/ma...')
#4 /html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(108): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Framewo...', Array)
#5 /html/vendor/magento/framework/ObjectManager/ObjectManager.php(56): Magento\Framework\ObjectManager\Factory\Compiled->create('Magento\\Framewo...', Array)
#6 /html/vendor/magento/framework/Image/Factory.php(47): Magento\Framework\ObjectManager\ObjectManager->create('Magento\\Framewo...', Array)
#7 /html/vendor/magento/module-catalog/Model/Product/Image.php(467): Magento\Framework\Image\Factory->create('/home/ma...')
#8 /html/vendor/magento/module-catalog/Model/Product/Image.php(487): Magento\Catalog\Model\Product\Image->getImageProcessor()
#9 /html/vendor/magento/module-catalog/Helper/Image.php(477): Magento\Catalog\Model\Product\Image->resize()
#10 /html/vendor/magento/module-catalog/Helper/Image.php(551): Magento\Catalog\Helper\Image->applyScheduledActions()
#11 /html/vendor/magento/module-catalog/Block/Product/ImageBuilder.php(141): Magento\Catalog\Helper\Image->getResizedImageInfo()
#12 /html/vendor/magento/module-catalog/Block/Product/AbstractProduct.php(516): Magento\Catalog\Block\Product\ImageBuilder->create()
#13 /html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Catalog\Block\Product\AbstractProduct->getImage(Object(Magento\Catalog\Model\Product\Interceptor), 'upsell_products...', Array)
#14 /html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Catalog\Block\Product\ProductList\Upsell\Interceptor->___callParent('getImage', Array)
#15 /html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Catalog\Block\Product\ProductList\Upsell\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Catalog\Model\Product\Interceptor), 'upsell_products...')
#16 /html/generated/code/Magento/Catalog/Block/Product/ProductList/Upsell/Interceptor.php(26): Magento\Catalog\Block\Product\ProductList\Upsell\Interceptor->___callPlugins('getImage', Array, Array)
#17 /html/vendor/magento/module-catalog/view/frontend/templates/product/list/items.phtml(193): Magento\Catalog\Block\Product\ProductList\Upsell\Interceptor->getImage(Object(Magento\Catalog\Model\Product\Interceptor), 'upsell_products...')
#18 /html/vendor/magento/framework/View/TemplateEngine/Php.php(59): include('/home/ma...')
#19 /html/vendor/magento/framework/View/Element/Template.php(270): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\Catalog\Block\Product\ProductList\Upsell\Interceptor), '/home/ma...', Array)
#20 /html/vendor/magento/framework/View/Element/Template.php(300): Magento\Framework\View\Element\Template->fetchView('/home/ma...')
#21 /html/vendor/magento/framework/View/Element/AbstractBlock.php(667): Magento\Framework\View\Element\Template->_toHtml()
#22 /html/vendor/magento/framework/View/Layout.php(558): Magento\Framework\View\Element\AbstractBlock->toHtml()
#23 /html/vendor/magento/framework/View/Layout.php(534): Magento\Framework\View\Layout->_renderBlock('product.info.up...')
#24 /html/vendor/magento/framework/View/Layout.php(489): Magento\Framework\View\Layout->renderNonCachedElement('product.info.up...')
#25 /html/vendor/magento/framework/View/Layout.php(586): Magento\Framework\View\Layout->renderElement('product.info.up...', false)
#26 /html/vendor/magento/framework/View/Layout.php(536): Magento\Framework\View\Layout->_renderContainer('content.aside', false)
#27 /html/vendor/magento/framework/View/Layout.php(489): Magento\Framework\View\Layout->renderNonCachedElement('content.aside')
#28 /html/vendor/magento/framework/View/Layout.php(586): Magento\Framework\View\Layout->renderElement('content.aside', false)
#29 /html/vendor/magento/framework/View/Layout.php(536): Magento\Framework\View\Layout->_renderContainer('main', false)
#30 /html/vendor/magento/framework/View/Layout.php(489): Magento\Framework\View\Layout->renderNonCachedElement('main')
#31 /html/vendor/magento/framework/View/Layout.php(586): Magento\Framework\View\Layout->renderElement('main', false)
#32 /html/vendor/magento/framework/View/Layout.php(536): Magento\Framework\View\Layout->_renderContainer('columns', false)
#33 /html/vendor/magento/framework/View/Layout.php(489): Magento\Framework\View\Layout->renderNonCachedElement('columns')
#34 /html/vendor/magento/framework/View/Layout.php(586): Magento\Framework\View\Layout->renderElement('columns', false)
#35 /html/vendor/magento/framework/View/Layout.php(536): Magento\Framework\View\Layout->_renderContainer('main.content', false)
#36 /html/vendor/magento/framework/View/Layout.php(489): Magento\Framework\View\Layout->renderNonCachedElement('main.content')
#37 /html/vendor/magento/framework/View/Layout.php(586): Magento\Framework\View\Layout->renderElement('main.content', false)
#38 /html/vendor/magento/framework/View/Layout.php(536): Magento\Framework\View\Layout->_renderContainer('page.wrapper', false)
#39 /html/vendor/magento/framework/View/Layout.php(489): Magento\Framework\View\Layout->renderNonCachedElement('page.wrapper')
#40 /html/vendor/magento/framework/View/Layout.php(586): Magento\Framework\View\Layout->renderElement('page.wrapper', false)
#41 /html/vendor/magento/framework/View/Layout.php(536): Magento\Framework\View\Layout->_renderContainer('root', false)
#42 /html/vendor/magento/framework/View/Layout.php(489): Magento\Framework\View\Layout->renderNonCachedElement('root')
#43 /html/vendor/magento/framework/View/Layout.php(955): Magento\Framework\View\Layout->renderElement('root')
#44 /html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\Layout->getOutput()
#45 /html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\View\Layout\Interceptor->___callParent('getOutput', Array)
#46 /html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\Layout\Interceptor->Magento\Framework\Interception\{closure}()
#47 /html/generated/code/Magento/Framework/View/Layout/Interceptor.php(39): Magento\Framework\View\Layout\Interceptor->___callPlugins('getOutput', Array, Array)
#48 /html/vendor/magento/framework/View/Result/Page.php(257): Magento\Framework\View\Layout\Interceptor->getOutput()
#49 /html/vendor/magento/framework/View/Result/Layout.php(170): Magento\Framework\View\Result\Page->render(Object(Magento\Framework\App\Response\Http\Interceptor))
#50 /html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\Result\Layout->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#51 /html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\View\Result\Page\Interceptor->___callParent('renderResult', Array)
#52 /html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Response\Http\Interceptor))
#53 /html/generated/code/Magento/Framework/View/Result/Page/Interceptor.php(26): Magento\Framework\View\Result\Page\Interceptor->___callPlugins('renderResult', Array, Array)
#54 /html/vendor/magento/framework/App/Http.php(139): Magento\Framework\View\Result\Page\Interceptor->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#55 /html/vendor/magento/framework/App/Bootstrap.php(256): Magento\Framework\App\Http->launch()
#56 /html/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
#57 {main}
  • Can you load the raw image in question in your browser? – Borche Glafche Sep 27 '18 at 8:57
  • Try to compress your image and check the size of it . – Ylgen Guxholli Sep 27 '18 at 11:28
  • @YlgenGuxholli my image size is 19.2KB – Pradeep Sanku Sep 27 '18 at 11:54
  • @BorcheGlafche yes i can load that image in the broweser – Pradeep Sanku Sep 27 '18 at 11:55
  • Can you try to use ImageMagick instead. And can you share us the broken image – Franck Garnier Sep 27 '18 at 13:39
0

The file types supported by Magento 2 GD2 :

 /**
 * Image output callbacks by type
 *
 * @var array
 */
private static $_callbacks = [
    IMAGETYPE_GIF => ['output' => 'imagegif', 'create' => 'imagecreatefromgif'],
    IMAGETYPE_JPEG => ['output' => 'imagejpeg', 'create' => 'imagecreatefromjpeg'],
    IMAGETYPE_PNG => ['output' => 'imagepng', 'create' => 'imagecreatefrompng'],
    IMAGETYPE_XBM => ['output' => 'imagexbm', 'create' => 'imagecreatefromxbm'],
    IMAGETYPE_WBMP => ['output' => 'imagewbmp', 'create' => 'imagecreatefromxbm'],
];

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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