php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60250 "FILE" section argument ignored
Submitted: 2011-11-09 09:35 UTC Modified: 2016-08-03 03:49 UTC
Votes:5
Avg. Score:3.0 ± 0.0
Reproduced:4 of 4 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: admin at eexit dot net Assigned:
Status: Not a bug Package: EXIF related
PHP Version: 5.3.8 OS: OSX 10.6.8
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: admin at eexit dot net
New email:
PHP Version: OS:

 

 [2011-11-09 09:35 UTC] admin at eexit dot net
Description:
------------
Hello,

According to the documentation, the exif_read_data() allows to speficy the section 
we want to return.
It seems the section argument "FILE" is not being considered and return the same 
result if 0 argument was given.

Extension informations:

EXIF Version: 1.4 $Id: exif.c 314376 2011-08-06 14:47:44Z felipe $
Supported EXIF: Version	0220
Supported filetypes: JPEG,TIFF

Test script:
---------------
<?php
var_dump(exif_read_data(__DIR__ . 'sample-1.jpg', 'FILE', true));
?>

Expected result:
----------------
array(1) {
  ["FILE"]=>
  array(6) {
    ["FileName"]=>
    string(12) "sample-1.jpg"
    ["FileDateTime"]=>
    int(1320829793)
    ["FileSize"]=>
    int(162)
    ["FileType"]=>
    int(2)
    ["MimeType"]=>
    string(10) "image/jpeg"
    ["SectionsFound"]=>
    string(0) "COMPUTED"
  }
}


Actual result:
--------------
array(2) {
  ["FILE"]=>
  array(6) {
    ["FileName"]=>
    string(12) "sample-1.jpg"
    ["FileDateTime"]=>
    int(1320829793)
    ["FileSize"]=>
    int(162)
    ["FileType"]=>
    int(2)
    ["MimeType"]=>
    string(10) "image/jpeg"
    ["SectionsFound"]=>
    string(0) ""
  }
  ["COMPUTED"]=>
  array(4) {
    ["html"]=>
    string(22) "width="10" height="10""
    ["Height"]=>
    int(10)
    ["Width"]=>
    int(10)
    ["IsColor"]=>
    int(0)
  }
}


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-10-18 21:59 UTC] rimantas dot ragainis at gmail dot com
It does not apply to FILE section only, it appears parameter $sections of function exif_read_data() is not handled properly. In every case the result was returned as the whole EXIF data ignoring desirable section(s): FILE, IFD0, EXIF, GPS, etc. The result was the same no matter whether passed as single string, comma separated string of these sections, integer 0 or NULL. I've tried on the following environments which led me to this conclusion:

* OSX 10.8.5 Darwin 12.5.0, PHP 5.4.16, EXIF 1.4 (supported 0220)
* Win 7 Ultimate 6.1.7601, PHP 5.4.7, EXIF 1.4 (supported 0220)
* Red Hat Enterprise Linux 5 2.6.18-194.el5, PHP 5.3.25, EXIF 1.4 (supported 0220)
* Ubuntu 2.6.38-8-server, PHP 5.3.5-1ubuntu7.8, EXIF 1.4 (supported 0220)
 [2016-08-03 03:49 UTC] kalle@php.net
-Status: Open +Status: Not a bug
 [2016-08-03 03:49 UTC] kalle@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.


 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Thu Jun 21 14:01:42 2018 UTC