Camera Serial Number in EXIF data...

Started Mar 21, 2005 | Discussions thread
Markku Hänninen Junior Member • Posts: 33
Re: Camera Serial Number in EXIF data...

The hardware serial numbers are actually in the files just after the EXIF-information. I used them to gather statistics of my pictures that I described in this thread:
http://forums.dpreview.com/forums/read.asp?forum=1022&message=11813166

This is a part of the (python) code that I used to extract the serial numbers, as you can see I loop through all EXIF-tags and then read 400 bytes after the last tag and see if that piece contains any serial numbers..

hw = [
("050xxxxxxx" , "14-54"),
("060xxxxxxx" , "50-200"),
("010xxxxxxx" , "50macro"),
("080xxxxxxx" , "EX-25"),
("040xxxxxxx" , "EC-14"),
("101xxxxx" , "FL-50"),
]

def gethw(self):
maxtag = 0
for tag in self.exif.values():
if isinstance(tag, EXIF.IFD_Tag):
t = tag.field_offset + tag.field_length
if t > maxtag:
maxtag = t
self.fp.seek(maxtag)
s = self.fp.read(400)
hw = []
for (serial, name) in self.hw:
if serial in s:
hw.append(name)
self.info.append("HW:%s" % "+".join(hw))

I can provide the whole code to anyone interested, what it does is it goes through a given directory on the hard disk and generates lines like this of each found picture file:

p3128965.jpg 8965 2005:03:12 14:40:43 Metering:Matrix Flash:No F/3.2 Bias:-1.0 Program:Aperture 50mm 1/60s ISO:400 ORF HW:50macro

I then have a separate program that goes through this file to generate graphs and statistics, which is still "under development" as it has been for couple of months..

Post (hide subjects) Posted by
Keyboard shortcuts:
FForum PPrevious NNext WNext unread UUpvote SSubscribe RReply QQuote BBookmark MMy threads
Color scheme? Blue / Yellow