--- imageapi_gd.original.install Thu Apr 30 15:16:09 2009 +++ imageapi_gd.install Thu Apr 30 15:32:05 2009 @@ -57,15 +57,16 @@ function imageapi_gd_requirements($phase ); } + // Test PHP memory_limit $memory_limit = ini_get('memory_limit'); + $requirements['imagecache_memory_limit'] = array( + 'title' => $t('ImageAPI GD Memory Limit'), + 'value' => $memory_limit == -1 ? t('-1 (Unlimited)') : $memory_limit, + ); - if (parse_size($memory_limit) < parse_size('96M')) { - $requirements['imagecache_memory_limit'] = array( - 'title' => $t('ImageAPI GD Memory Limit'), - 'value' => $memory_limit, - 'severity' => REQUIREMENT_WARNING, - 'description' => $t('It is highly recommended that you set you PHP memory_limit to 96M to use ImageAPI GD. A 1600x1200 images consumes ~45M of memory when decompressed and there are instances where ImageAPI GD is operating on two decompressed images at once.'), - ); + if ($memory_limit && $memory_limit != -1 && parse_size($memory_limit) < parse_size('96M')) { + $requirements['imagecache_memory_limit']['severity'] = REQUIREMENT_WARNING; + $requirements['imagecache_memory_limit']['description'] = $t('It is highly recommended that you set you PHP memory_limit to 96M to use ImageAPI GD. A 1600x1200 images consumes ~45M of memory when decompressed and there are instances where ImageAPI GD is operating on two decompressed images at once.'); } }