EXIF Nikon Model Barf on Scanned Photos

pashdown
pashdown's picture

Joined: 2007-02-22
Posts: 8
Posted: Fri, 2012-12-28 18:43


Gallery URL = http://pashpics.xmission.com/gallery2/main.php
Gallery version = 2.3.2 core 1.3.0.2
API = Core 7.54, Module 3.9, Theme 2.6, Embed 1.5
PHP version = 5.3.10-1ubuntu3.4 apache2handler
Webserver = Apache/2.2.22 (Ubuntu)
Database = mysql 5.5.28-0ubuntu0.12.04.3, lock.system=flock
Toolkits = ArchiveUpload, Dcraw, Ffmpeg, Getid3, Thumbnail, Exif, NetPBM, ImageMagick, jpegtran, Gd
Acceleration = none, none
Operating system = Linux pashpics 3.2.0-35-generic #55-Ubuntu SMP Wed Dec 5 17:42:16 UTC 2012 x86_64
Default theme = classic
gettext = enabled
Locale = en_US
Browser = Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11
Rows in GalleryAccessMap table = 191
Rows in GalleryAccessSubscriberMap table = 46625
Rows in GalleryUser table = 10
Rows in GalleryItem table = 43898
Rows in GalleryAlbumItem table = 450
Rows in GalleryCacheMap table = 0

When displaying Nikon Coolscan images, there is an unsightly error warning that looks like this:

"Notice: Undefined index: Model in /path/to/gallery2/modules/exif/lib/exifer/makers/nikon.inc on line 211"

This is due to the fact that Coolscan EXIF has no "Model" information in it. I fixed it with this patch. Unfortunately, I don't know if it stops all Nikon Model information from being displayed, because I didn't test against any other Nikon photos.

*** nikon.inc.old	2012-12-28 11:35:34.602777369 -0700
--- nikon.inc	2012-12-28 11:36:25.750782592 -0700
***************
*** 208,214 ****
  	if($result['Endien']=="Intel") $intel=1;
  	else $intel=0;
  	
! 	$model = $result['IFD0']['Model'];
  
  	//these 6 models start with "Nikon".  Other models dont.
  	if($model=="E700\0" || $model=="E800\0" || $model=="E900\0" || $model=="E900S\0" || $model=="E910\0" || $model=="E950\0") {
--- 208,216 ----
  	if($result['Endien']=="Intel") $intel=1;
  	else $intel=0;
  	
! 	if (isset($result['IFD0']['Model']))
! 	   $model = $result['IFD0']['Model'];
! 	else $model=0;
  
  	//these 6 models start with "Nikon".  Other models dont.
  	if($model=="E700\0" || $model=="E800\0" || $model=="E900\0" || $model=="E900S\0" || $model=="E910\0" || $model=="E950\0") {
 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Fri, 2012-12-28 19:50

Seems to me there was another similar patch somewhere in these forums
Or better yet I think it was an updated exif package.

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
pashdown
pashdown's picture

Joined: 2007-02-22
Posts: 8
Posted: Fri, 2012-12-28 19:55

Let me know if there is a better way. The "exif" program on Ubuntu 12.04.1 shows no Model on Nikon Coolscan images.

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Fri, 2012-12-28 20:05

While it is better not to have PHP notice warnings and the developer should ideally take care of preventing them, the real issue here is that a production server should not be configured to display such and you should change your php.ini file so that you have error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED for normal day to day use. This will show all errors, except for notices and coding standards warnings which are non-critical.

--
dakanji.com