Doc #63329 [Com]: Read Error

From: Date: Wed, 31 Oct 2012 20:26:06 +0000
Subject: Doc #63329 [Com]: Read Error
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-9040@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 Comment by: mail+php at requinix dot net Reported by: pam at metanet dot ch Summary: Read Error Status: Open Type: Documentation Problem Package: Documentation problem Operating System: Any PHP Version: Irrelevant Block user comment: N Private report: N New Comment: 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 Previous Comments: ------------------------------------------------------------------------ [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 (#9040) next »