|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #63329 Read Error
Submitted: 2012-10-22 06:52 UTC Modified: 2012-11-12 22:42 UTC
From: pam at metanet dot ch Assigned: salathe (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: Any
Private report: No CVE-ID: None
 [2012-10-22 06:52 UTC] pam at metanet dot ch
From manual page:
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:

// Throws "Read Error!"
$returnValue = exif_imagetype('less11bytes.txt');

// Workaround against a "Read Error!"
$returnValue = (filesize('less11bytes.txt') > 11)?exif_imagetype('less11bytes.txt'):false;


Expected result:
Notice:  exif_imagetype() [function.exif-imagetype]: Read error! in C:\xampp\htdocs\test.php on line 12



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-10-31 20:26 UTC] 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)"
 [2012-11-12 22:33 UTC]
Automatic comment from SVN on behalf of salathe
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 (
 [2012-11-12 22:42 UTC]
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.
 [2012-11-12 22:42 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: salathe
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Tue Dec 05 03:01:26 2023 UTC