php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #6787 read_exif_data returns data even without real exif date
Submitted: 2000-09-17 06:07 UTC Modified: 2002-04-01 19:32 UTC
From: serge at globalbeach dot com Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.0.2 OS: RH Linux 6.2
Private report: No CVE-ID: None
 [2000-09-17 06:07 UTC] serge at globalbeach dot com
Hi Guys,

It seems that read_exif_data builds certain fields like
FileName, FileDateTime, FileSize etc .. even when no real
EXIF data exists. So read_exif_data will always return something....!

This makes it a pain to test for the presence of actual EXIF data cause I have to do something like this:

$exif_data = @read_exif_data($upload);
if (isset ($exif_data['CameraMake'])) { 

Not very bullet proof ....

Would be nice if it would not return anything without the presence of actual EXIF data.

Thanks, Serge

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-09-17 07:20 UTC] rasmus@php.net
That's because some of this information is derived and not picked out of the exif header.  Check a common one like DateTime to see if there might be real exif data in the jpeg.

I suppose an extra entry could be added that would be set to true if any exif data is found so I have moved this to a feature request.
 [2002-04-01 19:32 UTC] sniper@php.net
AFAIK, this is fixed in CVS.
Try latest CVS snapshot from http://snaps.php.net/

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Dec 06 03:00:01 2025 UTC