ID: 31980 User updated by: sdteffen at gmail dot com Reported By: sdteffen at gmail dot com -Status: Feedback +Status: Open Bug Type: EXIF related Operating System: Windows XP PHP Version: 4.3.10 New Comment:
Thanks for the comments. I've updated my code according to Pierre's suggestion: ini_set('exif.decode_unicode_intel', 'UCS-2LE'); ini_set('exif.encode_unicode','ISO-8859-1'); ini_set('exif.encode_jis','ISO-8859-1'); ini_set('exif.decode_jis_intel','ISO-8859-1'); $arrComment = exif_read_data('1.jpg', 'WINXP', true); The problem still exists (Only first letter is returned). Here's the example file: http://sdteffen.de/1.jpg Previous Comments: ------------------------------------------------------------------------ [2005-02-15 10:19:19] [EMAIL PROTECTED] > The constant EXIF_USE_MBSTRING is 0 - isn't this a > contradiction with the PHP Manual that says > "Windows users must also have the mbstring > extension enabled"? Loading the mbstring extension is one of the requirement, another is to specify the encoding (See http://de.php.net/exif) using either php.ini or ini_set. If the problem remains, please provide a link to the image as requested by Sniper. --Pierre ------------------------------------------------------------------------ [2005-02-15 10:11:26] [EMAIL PROTECTED] Put that image file somewhere where we can download it and try ourselves. ------------------------------------------------------------------------ [2005-02-15 07:47:36] sdteffen at gmail dot com Description: ------------ I'm trying to extract EXIF information created by the Windows XP Explorer (In particular the Comments field). Dumping the array created by exif_read_data('c:\test.jpg','WINXP',true); includes the following result: ["WINXP"]=> array(1) { ["Comments"]=> string(1) "G" } The problem is that the comment is not only the letter "G", but a full sentence (starting with G). Apparently, the comment is UNICODE (UCS-2?). I tried to use mb_string (Loading php_mbstring.dll before php_exif.dll like outlined in the PHP manual) without success. The constant EXIF_USE_MBSTRING is 0 - isn't this a contradiction with the PHP Manual that says "Windows users must also have the mbstring extension enabled"? If this is not a bug, please consider it as a request to enhance the PHP Manual with a small example showing the necessary php.ini configurations to use in conjuction with Windows XP Explorer EXIF comments. Windows Explorer is the most convenient application for our users to add EXIF comments. PHP 4.3.10 Zipfile distribution, using the CGI (php.exe). Reproduce code: --------------- exif_read_data('c:\test.jpg','WINXP',true); Expected result: ---------------- ["WINXP"]=> array(1) { ["Comments"]=> string(1) "G" } Actual result: -------------- ["WINXP"]=> array(1) { ["Comments"]=> string(1) "Generator and pump" } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=31980&edit=1