Voterbox

NoLoveFromGoogle: PHP exif_read_data Returns a Single Character with WINXP Array

Interesting issue this week. Using the exif methods to read WINXP data returns unexpected results unless both exif and mbstring are compiled statically.

The exif_read_data function with WINXP data from a Jpeg image only returns a single character for each item in the array. Digging around on bugs.php.net came up with several instances of the bug over the last 5 years. Please reference the following bug reports:

Bug #31980
Bug #23105

Most notably, the comments in the last bug from 2003:

"[8 Apr 2003 4:26pm UTC] edink@php.net

This cannot be fixed due to the fact that mbstring has been removed from PHP core (it has been 'unbundled') and the rest of core files and other extensions cannot use mbstring functionality when it is compiled as a shared library (dll).
"

If exif is compiled statically (--enable-exif) and mbstring compiled as a DSO module (--enable-mbstring=shared) then exif_read_data may only return a single character rather than the entire string.

Compiling both exif and mbstring statically (--enable-exif --enable-mbstring) resolves the issue.

All content generally available under the GPL unless otherwise noted.
5dollarwhitebox.org is not responsible in anyway for actions performed based on information found on this site.

Powered by Drupal - Design by Artinet