note 104913 added to function.imagepng

From: Date: Fri, 15 Jul 2011 06:38:11 +0000
Subject: note 104913 added to function.imagepng
Groups: php.notes 
Request: Send a blank email to php-notes+get-181548@lists.php.net to get a copy of this message
My script was unable to complete: Fatal error: Allowed memory size of XX bytes exhausted (tried to allocate XX+n bytes). I found out that PHP handles images in uncompressed format: my input image was 8768x4282@32 bit => ~150 MB per single in-memory copy. As a solution, you can either check the dimensions and reject anything too big or, as I did, use ini_set('memory_limit','1024M'); on the page start (if your server has enough on board memory). ---- Server IP: 81.88.49.33 Probable Submitter: 151.42.214.238 ---- Manual Page -- http://www.php.net/manual/en/function.imagepng.php Edit -- https://master.php.net/note/edit/104913 Del: integrated -- https://master.php.net/note/delete/104913/integrated Del: useless -- https://master.php.net/note/delete/104913/useless Del: bad code -- https://master.php.net/note/delete/104913/bad+code Del: spam -- https://master.php.net/note/delete/104913/spam Del: non-english -- https://master.php.net/note/delete/104913/non-english Del: in docs -- https://master.php.net/note/delete/104913/in+docs Del: other reasons-- https://master.php.net/note/delete/104913 Reject -- https://master.php.net/note/reject/104913 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#181548) next »