Pixelpost

Authentic Photoblog Flavour


Go Back   Pixelpost Forum > SUPPORT / INFORMATION > Pixelpost Help

Post Reply
 
Thread Tools
  #1  
Old 10-07-2006, 11:11 PM
hdt Offline
forum loafer
 
Join Date: Oct 2006
Posts: 4
EXIFER bug (iso 6553700, 13107400, ...)

At first when I saw these ISO's I thought it's a problem with my image editing program, but when I realize that the same image is read with the correct ISO in my desktop programs (not only the one I edit the image with), I started digging into why the exifer is reading some ISO information incorrectly.

Long story short I learned a little about php and exif reading (I'm a programmer but didn't really know much about both), and I believe I've found a fix for this issue.
EXIFER sometimes reads the exif information as a 4 byte data, and sometimes as a 2 byte data, and when it's reading it as a 4 byte data it has the iso information twice in it. I can't really explain why since I didn't really dig into that part when fixing it, but focused on 'fixing' the 4 byte data instead.

So for example, as a 2 byte data, ISO '100' is :
0x00000064 (hex).
In images where iexifer's reading it as a 4 byte data, it has this data:
0x00640064
And of course, 0x00640064 in hex translates to... 65553700 in decimal. (ISO 200 -> 0x00C800C8 -> 13107400, etc)

My solution is to do this in line 397 of exif.php, last line in this snippet (in formatData method):
Code:
	} else if($type=="USHORT" || $type=="SSHORT" || $type=="ULONG" || $type=="SLONG" || $type=="FLOAT" || $type=="DOUBLE") {
		$data = bin2hex($data);
		if($intel==1) $data = intel2Moto($data);
		if($intel==0 && ($type=="USHORT" || $type=="SSHORT")) $data = substr($data,0,4);
		$data=hexdec($data);
		if ($tag="8827") $data=65535&$data; //mask 2 bytes for ISO rating
(Mask ISO data with 0x0000FFFF)

I've tested this with both images that were read correctly and incorrectly previously and looks like it worked.

Anyway, I thought I'd share this and my explanation (because I may not be 100% correct, since like I said, before I started I didn't really know much about php and reading EXIF).

Last edited by Dennis; 04-10-2007 at 07:42 PM.
Reply With Quote
  #2  
Old 10-08-2006, 07:18 AM
Connie
Guest
 
Posts: n/a
that is a good point.... thanks!

I will add this as info to our todo-list! thanks again!
Reply With Quote
  #3  
Old 10-08-2006, 09:51 PM
GeoS's Avatar
GeoS+ Offline
Team Pixelpost
 
Join Date: Apr 2005
Location: Warsaw, Poland
Posts: 3,700
Send a message via ICQ to GeoS Send a message via Skype™ to GeoS
IMHO it should be:
Code:
if ($tag == "8827") $data=65535&$data; //mask 2 bytes for ISO rating
__________________
photoblog | portfolio | addons | Donate

Last edited by Dennis; 04-10-2007 at 07:41 PM.
Reply With Quote
  #4  
Old 10-09-2006, 10:25 PM
hdt Offline
forum loafer
 
Join Date: Oct 2006
Posts: 4
Haha yes absolutely , good catch. I made another typo there also.. tag should be 8827, not 8227...
So make that

Code:
if ($tag == "8827") $data=65535&$data; //mask 2 bytes for ISO rating
I also just noticed that in Opera browser, which shows EXIF info when you right click->Image properties, it shows the double ISO data separated by comma (ISO speed rating: 100, 100). So there's probably a purpose for the other ISO data field in the EXIF which someone with deeper EXIF knowledge can probably explain...

Last edited by GeoS; 10-10-2006 at 04:32 PM. Reason: Added code tag around code :P
Reply With Quote
  #5  
Old 03-25-2007, 03:19 AM
dhdesign's Avatar
dhdesign Offline
pixelpost guru
 
Join Date: Mar 2007
Location: Ohio
Posts: 433
Thanks for this solution! Was able to resolve one issue I've been having this evening with exif data.
Reply With Quote
  #6  
Old 09-05-2009, 09:58 AM
maheen Offline
forum loafer
 
Join Date: Sep 2009
Posts: 1
yes its really very useful. I have observed that people in this forum are very helpful and very responsive
__________________
E20-850, EX0-100, EX0-101
Reply With Quote
Post Reply


Thread Tools




All times are GMT. The time now is 02:12 AM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd. | Style Design: d3 designs