A fresh install of exif, with the helper enabled.
OSX, slightly home-brewed php build, but with --enable-exif on and valid.

EXIF Version 	1.4 $Id: exif.c,v 1.173.2.5.2.26 2008/08/03 12:11:13 jani Exp $
Supported EXIF Version 	0220 

Visiting /admin/settings/exif from the admin section produces WSOD.

In the php/apache error.log:

[Thu Aug 27 14:34:40 2009] [notice] child pid 344 exit signal Bus error (10)

???

In the Drupal log:
Array to string conversion in /Library/WebServer/Documents/drupal6/sites/images/modules/contributions/exif/exif.module on line 184.

	foreach ($ar_exif as $key => $value){
		if(is_array($value)){
			$rows[] = array('data'=>array($key,$help),'class'=>'tag_type');
			foreach($value as $key2 => $value2){
				$rows[] = array('data'=>array($key2,check_plain(utf8_encode($value2))));
				^ line 184

:- PS, the code style is full of tabs :(

aand ... I added a debug line and the problem went away. And I removed the debug line and it came back.
.. Um? That's odd.

OK, as hinted at by the error text, some of the 'values' are in fact coming out as arrays:

GPS (Array, 7 elements)
      GPSVersion (String, 4 characters ) 
      GPSLatitudeRef (String, 1 characters ) N
      GPSLatitude (Array, 3 elements)
            0 (String, 4 characters ) 51/1
            1 (String, 4 characters ) 17/1
            2 (String, 19 characters ) 2147483601/41521338
      GPSLongitudeRef (String, 1 characters ) E
      GPSLongitude (Array, 3 elements)
            0 (String, 4 characters ) 12/1
            1 (String, 4 characters ) 13/1
            2 (String, 20 characters ) 2147483638/151018540
      GPSAltitudeRef (String, 1 characters )
      GPSAltitude (String, 3 characters ) 0/1

How clever. It seems that the EXIF parser is now reading more info out of GPS than it was earlier. We should be able to work around that.

Trying on another image sample (the path to sample.jpg should be exposed and user-configurable BTW) I don't get that error because the source had no geodata
I DO however get a new error : Incorrect APP1 Exif Identifier Code although I'm not sure what brought that on.
A few more tests suggest it's only geodata that has problems.

I'd like to try passing back a small patch, but the current code style prohibits me being able to do that.
If this module was cleaned up to Drupal code conventions (heaps of whitespace problems) then I'd like to help out, but it's a pain to work around without creating lots of diff errors at the moment.

Comments

dman’s picture

I'm also getting a hundred notices with php-strict error logging on. We need a code style review.

# notice: Undefined variable: teaser in /Library/WebServer/Documents/drupal6/sites/images/modules/contributions/exif/exif.module on line 69.
# notice: Undefined offset: 1 in /Library/WebServer/Documents/drupal6/sites/images/modules/contributions/exif/exif.class.php on line 43.
...
raintonr’s picture

Status: Active » Needs review

I have posted a combined patch that fixes (for my at least) this Geo problem and #473140: No EXIF data is extracted from images.

See:

http://drupal.org/node/473140#comment-2000156

raintonr’s picture

Status: Needs review » Closed (duplicate)

Given the progress on #473140: No EXIF data is extracted from images this should now be considered a duplicate of that.