This is a static dump of issues in the old "Flyspray" bugtracker for DokuWiki. Bugs and feature requests
are now tracked at the issue tracker at Github.
Closed
Implemented
FS#655 resize_imageGD
Backend
2005-12-02Peep
The resize function does not check the memory limitations. It should display the original picture when not possible to resize the image instead of running out of memory = no picture at all.
2005-12-03andi
As far as I know you can't catch an "Out-Of-Memory-Exception" in PHP so the gd_resize function can't check for this error. A solution may be to check the original's image size and compare it to the set memory limit. I recommend to use image magick if possible to avoid these problems.
2005-12-03Peep
Yes, you're right. But the bug is not showing anything when it happens. So the solution is to check whether:
function return_bytes($val) {
$val = trim($val);
$last = strtolower($val{strlen($val)-1});
switch($last) {
// The 'G' modifier is available since PHP 5.1.0
case 'g':
$val *= 1024;
case 'm':
$val *= 1024;
case 'k':
$val *= 1024;
}
return $val;
}
I've added this function and 2 lines of code into our installation and works just fine. So please patch it in the code, this out-of-memory bug can be hardly detected and fixed different way.