#25230 [NEW]: Doc page of exif_read_data() might go wrong about 'arrays' parameter
| From: | dallas@php.net | Date: | Mon, 25 Aug 2003 01:10:57 +0000 |
| Subject: | #25230 [NEW]: Doc page of exif_read_data() might go wrong about 'arrays' parameter | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969356099@lists.php.net to get a copy of this message | ||
From: dallas@php.net
Operating system:
PHP version: 4CVS-2003-08-24 (stable)
PHP Bug Type: Documentation problem
Bug description: Doc page of exif_read_data() might go wrong about 'arrays' parameter
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
)
...
--
Edit bug report at http://bugs.php.net/?id=25230&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=25230&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=25230&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=25230&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=25230&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=25230&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=25230&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=25230&r=support
Expected behavior: http://bugs.php.net/fix.php?id=25230&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=25230&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=25230&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=25230&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25230&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=25230&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=25230&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=25230&r=gnused