Jump to content

Some GD functions crash at random; fixed by calling ob_flush first (?!?!)


CGameProgrammer

Recommended Posts

My image script has recently (for some reason) begun crashing at random in the ImageCopy or ImageCopyResampled calls, with the same (valid) input image and no memory limit. This frustrated me until by change I discovered that calling ob_flush anywhere before the image functions, even right at the beginning of the script, makes it work. But the output buffer is empty (confirmed both with ob_get_contents and ob_get_length). So why are these GD functions crashing?

 

And when I say crashing, I mean exactly that. No exception gets thrown, no error gets logged to Apache's or PHP's error logs, and execution of the script halts immediately.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.