Bug #67108 [Opn->Nab]: imageCreateFromJpeg (or any other function) must not terminate script silently

From: Date: Tue, 22 Apr 2014 06:54:45 +0000
Subject: Bug #67108 [Opn->Nab]: imageCreateFromJpeg (or any other function) must not terminate script silently
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-185366@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67108&edit=1 ID: 67108 Updated by: pajoye@php.net Reported by: romtek at gmail dot com Summary: imageCreateFromJpeg (or any other function) must not terminate script silently -Status: Open +Status: Not a bug Type: Bug Package: GD related Operating System: Windows, Linux PHP Version: 5.5.11 Block user comment: N Private report: N New Comment: It is by design. Out of memory (be with memory limit or system) should not allow any other operation as it can't end well anyway. Nothing can be allocated anymore, so how would we manage errors (msg, stack, etc)? If you use a the memory limite and need more for specific areas, you can change it via php.ini (and the likes). Previous Comments: ------------------------------------------------------------------------ [2014-04-22 06:44:57] romtek at gmail dot com Description: ------------ The notorious situation: calling imageCreateFromJpeg() terminates the calling script SILENTLY when it can't allocate enough memory, leaving no way to gracefully handle the situation. Even using set_error_handler() is useless in this case. This problem is widely known and talked about for a long time. While terminating a script silently is OK for a project in Programming 101 course, it unacceptable for a business website. Please make it so this function (and all other functions in PHP) allow for graceful handling of errors. This could be throwing an exception or returning an error code. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=67108&edit=1

« previous php.bugs (#185366) next »