#25230 [Opn->Csd]: Doc page of exif_read_data() might go wrong about 'arrays' parameter

From: Date: Mon, 25 Aug 2003 03:58:03 +0000
Subject: #25230 [Opn->Csd]: Doc page of exif_read_data() might go wrong about 'arrays' parameter
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969356100@lists.php.net to get a copy of this message
ID: 25230 Updated by: dallas@php.net Reported By: dallas@php.net -Status: Open +Status: Closed Bug Type: Documentation problem PHP Version: 4CVS-2003-08-24 (stable) New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [2003-08-24 20:10:56] 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 ) ... ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=25230&edit=1

« previous php.doc (#969356100) next »