note 96162 added to function.imagick-valid

From: Date: Thu, 11 Feb 2010 19:01:21 +0000
Subject: note 96162 added to function.imagick-valid
Groups: php.notes 
Request: Send a blank email to php-notes+get-165882@lists.php.net to get a copy of this message
We found this method to be of value when checking most image file types. However, it does not appear to be rigorous enough to detect corrupt jpg files. We use the following for jpgs and validate() for everything else. <?php // check for the existence of the EOI segment header at the end of the file if (0 !== fseek($file, -2, SEEK_END) || "\xFF\xD9" !== fread($file, 2)) { fclose($file); return FALSE; } ?> ---- Server IP: 69.147.83.197 Probable Submitter: 173.8.91.177 ---- Manual Page -- http://www.php.net/manual/en/function.imagick-valid.php Edit -- https://master.php.net/note/edit/96162 Del: integrated -- https://master.php.net/note/delete/96162/integrated Del: useless -- https://master.php.net/note/delete/96162/useless Del: bad code -- https://master.php.net/note/delete/96162/bad+code Del: spam -- https://master.php.net/note/delete/96162/spam Del: non-english -- https://master.php.net/note/delete/96162/non-english Del: in docs -- https://master.php.net/note/delete/96162/in+docs Del: other reasons-- https://master.php.net/note/delete/96162 Reject -- https://master.php.net/note/reject/96162 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#165882) next »