Doc #63329 [Opn->Csd]: Read Error

From: Date: Mon, 12 Nov 2012 22:42:06 +0000
Subject: Doc #63329 [Opn->Csd]: Read Error
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-9105@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=63329&edit=1 ID: 63329 Updated by: salathe@php.net Reported by: pam at metanet dot ch Summary: Read Error -Status: Open +Status: Closed Type: Documentation Problem Package: Documentation problem Operating System: Any PHP Version: Irrelevant -Assigned To: +Assigned To: salathe Block user comment: N Private report: N New Comment: This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. Committed requinix's patch. Previous Comments: ------------------------------------------------------------------------ [2012-11-12 22:33:58] salathe@php.net Automatic comment from SVN on behalf of salathe Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=328333 Log: exif_imagetype (actually standard/image.c, php_getimagetype) requires between 3 and 12 bytes in a file, otherwise it E_NOTICEs. (doc #63329) -- Provided by anonymous #22227 (mail+php@requinix.net) ------------------------------------------------------------------------ [2012-10-31 20:26:06] mail+php at requinix dot net It requires somewhere between 3 and 12 bytes, depending on what it finds as it reads bytes in from the file. At least it's just a notice, right? Did you know you can easily submit changes to the online documentation? Look for the [edit] link in the top-right corner of manual pages. I've created a patch mentioning the caveat: "exif_imagetype requires a minimum number of bytes (bug #63329)" http://edit.php.net/?patchID=756&project=PHP ------------------------------------------------------------------------ [2012-10-22 06:52:58] pam at metanet dot ch Description: ------------ --- From manual page: http://www.php.net/function.exif-imagetype#refsect1-function.exif-imagetype-returnvalues --- Can you propably write in the php doc that if the file is smaller than 11 bytes and you call the function exif_imagetype() for it, there is a "Read Error!" thrown. Test script: --------------- <?php // Throws "Read Error!" $returnValue = exif_imagetype('less11bytes.txt'); var_dump($returnValue); // Workaround against a "Read Error!" $returnValue = (filesize('less11bytes.txt') > 11)?exif_imagetype('less11bytes.txt'):false; var_dump($returnValue); ?> Expected result: ---------------- Notice: exif_imagetype() [function.exif-imagetype]: Read error! in C:\xampp\htdocs\test.php on line 12 bool(false) bool(false) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=63329&edit=1

« previous php.doc.bugs (#9105) next »