Closed GoogleCodeExporter closed 8 years ago
A "nicer" one would be:
if (return_bytes(ini_get('memory_limit'))<3145728) {
// set memory limit to be able to have enough space to resize larger images
ini_set ('memory_limit', MEMORY_LIMIT);
}
function return_bytes ($size_str)
{
switch (substr ($size_str, -1))
{
case 'M': case 'm': return (int)$size_str * 1048576;
case 'K': case 'k': return (int)$size_str * 1024;
case 'G': case 'g': return (int)$size_str * 1073741824;
default: return $size_str;
}
}
but that's a bit verbose
Original comment by jadw...@gmail.com
on 26 May 2011 at 12:46
Nice one guys. Incorporated your code and it's in the repo now.
Original comment by mmaun...@gmail.com
on 7 Aug 2011 at 2:01
Original issue reported on code.google.com by
jadw...@gmail.com
on 26 May 2011 at 12:37Attachments: