If you run in out-of-memory (OOM) errors during the product image import, chances are you are running into a bug in Magento regarding image conversion during CSV imports.

In the Magento admin backend, it appears as if your csv import is still running, but in the error logs you’ll notice errors that appeared during the import.

In the access logging a 502 status code is returned.

This error is caused by a bug in the Gd2.php library Magento uses to convert image formats.

To fix this issue, use the instructions to fix this bug.

Instructions for manual repair

  • Create the new destination for this file:

  • Copy the Gd2.php file to it’s destination:

  • open /data/web/public/app/code/local/Varien/Image/Adapter/Gd2.php with your favorite editor:

  • Go to register_shutdown_function on line 49 and change this line:
    From:

    To:

  • Keep the file open in your editor, and change line 55:
    From:

    To:

This should lower the memory of the image resize functionality drastically.

This issue was found and solved with lots of help from Jan Buelens, working for our partner PHPro

20