Skip to content

Instantly share code, notes, and snippets.

@fbrnc
Created April 16, 2013 21:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fbrnc/5399929 to your computer and use it in GitHub Desktop.
Save fbrnc/5399929 to your computer and use it in GitHub Desktop.
If your images are not rendering check you php memory_limit settings. Magento doesn't support the "1G" notation. Apply this fix to your sources:
Index: lib/Varien/Image/Adapter/Gd2.php
===================================================================
--- lib/Varien/Image/Adapter/Gd2.php (revision 143037)
+++ lib/Varien/Image/Adapter/Gd2.php (revision 143038)
@@ -82,7 +82,9 @@
*/
protected function _convertToByte($memoryValue)
{
- if (stripos($memoryValue, 'M') !== false) {
+ if (stripos($memoryValue, 'G') !== false) {
+ return (int)$memoryValue * 1024 * 1024 * 1024;
+ } elseif (stripos($memoryValue, 'M') !== false) {
return (int)$memoryValue * 1024 * 1024;
} elseif (stripos($memoryValue, 'KB') !== false) {
return (int)$memoryValue * 1024;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment