|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31980 Unable to Extract Windows XP EXIF Information
Submitted: 2005-02-15 07:47 UTC Modified: 2005-02-16 15:40 UTC
From: sdteffen at gmail dot com Assigned: edink (profile)
Status: Closed Package: EXIF related
PHP Version: 4CVS, 5CVS (2005-02-15) OS: win32 only
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.
Bug Type:
From: sdteffen at gmail dot com
New email:
PHP Version: OS:


 [2005-02-15 07:47 UTC] sdteffen at gmail dot com
I'm trying to extract EXIF information created by the Windows XP Explorer (In particular the Comments field).

Dumping the array created by


includes the following result:

  array(1) {
    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:

Expected result:
  array(1) {
    string(1) "G"

Actual result:
  array(1) {
    string(1) "Generator and pump"


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-02-15 10:11 UTC]
Put that image file somewhere where we can download it and try ourselves.

 [2005-02-15 10:19 UTC]
> 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 using either php.ini or ini_set.

If the problem remains, please provide a link to the image  as requested by Sniper.

 [2005-02-15 12:22 UTC] sdteffen at gmail dot com
Thanks for the comments.
I've updated my code according to Pierre's suggestion:

ini_set('exif.decode_unicode_intel', 'UCS-2LE');
$arrComment = exif_read_data('1.jpg', 'WINXP', true);

The problem still exists (Only first letter is returned).

Here's the example file:
 [2005-02-15 13:48 UTC]
Nevermind, in windows the EXIF module isn't compiled with MBSTRING support.

 [2005-02-15 13:52 UTC]
Assigning to our win32 build guru..

 [2005-02-16 11:00 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

 [2005-02-16 15:40 UTC] sdteffen at gmail dot com
Thanks for the quick fix.
However, it looks like php_exif.dll is missing from the
snapshot zip file.
I checked

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Jun 02 19:03:43 2023 UTC