Skip to main content

Learning how to capture the EXIF Data.

It's been fun writing the code for this site. I've been laid up with a bad cold for a few days, and this has been the perfect opportunity to do some deep feeding on computer code.
I already had a reasonable understanding of HTML, PHP and MySql. (For the already bored, these are a couple of hand in hand computer languages that allow websites to be built and made "reactive" through the questioning of a database.)
The really interesting thing has been working on the interface between digital images and computer programs.
Most digital images contain lots of bits that work together to make up a picture. I already knew that. I also knew that every digital image was attached to a data file called EXIF date. (EXIF means Exchangeable Image File Format by the way). Getting boring here, so get back to the interesting bit.
I discovered that this EXIF data is attached to each image. It records such things as the camera equipment used and the settings of that equipment, and as a photographer I find that info really interesting. If I know the settings and the equipment used to make a picture, it often gives me insight into the cause and effect of picture making. So the first thing I had to do was find a way of getting that info off the tiny little card and into characters on my computer.
For example,


echo $ExposureTime;     echo " shutterspeed<br/>";
$ISOSpeedRatings      = $exif['EXIF']['ISOSpeedRatings'];

is part of the key to finding out the ISO (ISO refers to your camera sensor's sensitivity to light). There were quite a few of there keys to allow me to record and publish the settings for each image. You can study these settings while you look at the image. It can give insights.
The other REALLY interesting bit is this. My camera contains a GPS system and it records the Latitude and Longitude coordinates when it takes a picture, provided it can "see" the satellite and provided I have GPS turned on. (Sometimes I turn it off because it is battery hungry).
With this data I can give you a link to Google Maps and you can see where I was on the planet when I took the shot.
Here is some more gobbleygook to explain how I get the info.

return floatval($parts[0]) / floatval($parts[1]);}
$exif = exif_read_data($fileTarget);
$lon = getGps($exif["GPSLongitude"], $exif['GPSLongitudeRef']);

More boring. OK, but I like it. It's such a buzz when the code suddenly works after hours of testing.

You can click on a Google Earth link if you enter the search codes 264 or 265. The link will take you to where I took the photo.
Neat, huh. Anyway, I hope you enjoy the show.

Comments

Trisha Grey said…
Hi Frank - just practising how to communicate via blog /not my usual method! Who will you be flying with? Trish
Melusade said…
Hi Trisha. We're flying with Singapore Airlines. This is a practise for me too. Replying to a comment. I hope the reply reaches you.

Popular posts from this blog

Seven Big Sleeps

Next week we fly out of Tullamarine for Singapore and then on to Rome. We've been packing and repacking for a couple of weeks. I have a couple of problems. My checked baggage allowance is generous and the cabin baggage allowance not so generous. I want to carry an Apple Macbook as well as a sleep pump (I suffer from Sleep Apnoea) and a Full Frame DSLR camera as well as three lenses. Because these things are fragile and easily stolen I want them close by. This makes it a bit of a juggle to weigh everything and make sure I can carry aboard. Anyway, all looks good so far. Better get the passports and put them somewhere I won't forget.

Saints, murder and curses in Orvieto.

It's raining lightly on the first day of spring here in Orvieto. The light for photography is still poorly and sickly so we rose early in the hope of getting some good early morning shots as we wandered the empty streets. We set out at about 5:00 am and headed roughly in the direction of the Duomo, or Cathedral. It was not at all cold, and I was comfortable in a T-shirt until after dawn when it got quite chilly. The Duomo has an impressive facade, and though it was not open in the early hours, the detail on the facade was enough reward. The facade is extremely ornate with lots of narrative sculpture over the whole of the area. There are three huge bronze double doors across the front, with very large figures in bronze relief. The frontage is composed of numerous bas-reliefs, bronze statues huge religious images that must be mosaic and columns embellished with glittering patterns of golden mosaics. We took some photographs which will find their way to the photo pages of Orvieto...