I am using the Regenerate Thumbnails WordPress plugin, which works on smaller images but for anything that's larger then about 800K it says:
The resize request was abnormally terminated (ID 496). This is likely due to the image exceeding available memory or some other type of fatal error.
I have traced the error to line 372 of regenerate-thumbnails.php:
$metadata = wp_generate_attachment_metadata( $image->ID, $fullsizepath );
On small images this function call will return the result as it is suppose to, but on bigger images it will stop execution, resulting in an empty ajax response (the error message itself is created using JavaScript on line 285).
It seems weird that it would be a memory error because the memory limit is 120M. So my question is why dose this function sometimes work and other times crash. And more importantly, how to fix it.