There is a known bug in the GD library of Magento CE 1.x where it can't handle memory limits other than in KB or MB. To solve the issue and assign higher memory limits (GB), you will need to make the following changes to the file /lib/Varien/Image/Adapter/Gd2.php
:
Find:
protected function _convertToByte($memoryValue)
{
if (stripos($memoryValue, 'M') !== false) {
return (int)$memoryValue * 1024 * 1024;
}
elseif (stripos($memoryValue, 'KB') !== false) {
return (int)$memoryValue * 1024;
}
return (int)$memoryValue;
}
Add the following lines before the final return
statement:
elseif (stripos($memoryValue, 'G') !== false) { // Support value in gigabytes
return (int)$memoryValue * 1024 * 1024 * 1024;
}
elseif (trim($memoryValue) == '-1') { // Support unlimited memory
return 8589934592; // Use 8GB
}
Thanks to Sangay Tenzin and @Josef for making this info available.
/lib/Varien/Image/Adapter/Gd2.php
is the function ` _convertToByte` that doesn't know about GB or -1! add:elseif (stripos($memoryValue, 'G') !== false) { return (int)$memoryValue * 1024 * 1024 * 1024; } elseif (trim($memoryValue) == '-1') { return 8589934592; }