php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #25230 Doc page of exif_read_data() might go wrong about 'arrays' parameter
Submitted: 2003-08-24 20:10 UTC Modified: 2003-08-24 22:58 UTC
From: dallas@php.net Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4CVS-2003-08-24 (stable) OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: dallas@php.net
New email:
PHP Version: OS:

 

 [2003-08-24 20:10 UTC] dallas@php.net
Description:
------------
In page http://www.php.net/exif_read_data, it was said:

arrays specifies whether or not each section becomes an array. The sections FILE, COMPUTED and THUMBNAIL allways become arrays as they may contain values whose names are conflict with other sections.

However, in current CVS of PHP source, file 'ext/exif/exif.c' shows:

add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_FILE       TSRMLS_CC);
add_assoc_image_info(return_value, 1,          &ImageInfo, SECTION_COMPUTED   TSRMLS_CC);
add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_ANY_TAG    TSRMLS_CC);
add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_IFD0       TSRMLS_CC);
add_assoc_image_info(return_value, 1,          &ImageInfo, SECTION_THUMBNAIL  TSRMLS_CC);
add_assoc_image_info(return_value, 1,          &ImageInfo, SECTION_COMMENT    TSRMLS_CC);
add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_EXIF       TSRMLS_CC);
add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_GPS        TSRMLS_CC);
add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_INTEROP    TSRMLS_CC);
add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_FPIX       TSRMLS_CC);
add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_APP12      TSRMLS_CC);
add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_WINXP      TSRMLS_CC);
add_assoc_image_info(return_value, sub_arrays, &ImageInfo, SECTION_MAKERNOTE  TSRMLS_CC);

I suppose it means sections COMPUTED, THUMBNAIL and COMMENT will always become array, but not FILE section.  A sample code proved this.

Reproduce code:
---------------
<?php
$image_data = exif_read_data('somefile.jpg');
print_r($image_data);
?>


Expected result:
----------------
Array
(
    [FileName] => h.jpg
    [FileDateTime] => 1061726541
    [FileSize] => 103018
    [SectionsFound] => ANY_TAG, IFD0, THUMBNAIL, EXIF, INTEROP
    [COMPUTED] => Array
        (
            [html] => width="1024" height="768"
            [Height] => 768
            [Width] => 1024
            [IsColor] => 1
            [ApertureFNumber] => f/3.4
            [UserComment] =>  
            [UserCommentEncoding] => UNDEFINED
        )
...


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-08-24 22:58 UTC] dallas@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jun 17 18:01:31 2024 UTC