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

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...

Cobblestones

I remember reading that the revolutionaries of Paris tore up the cobblestones to make barricades and to use them as missiles. I wondered this morning if there may be a barricade forming in our street. Certainly it would be difficult to use these cobblestones as missiles for each would have to weigh several kilos. The image on the right is an historical one from Paris, but that on the left is from outside our door in Rome.  Today we went for a walk in the Jewish Ghetto of Rome which largely consists of intriguing and meandering laneways. The ghetto was originally created by Pope Paul in 1555, and a surrounding wall was constructed with one gate in and one out. The occupants were forbidden to trade in anything but clothing and real estate.  On October 16, 1943, Nazis took 1023 jews by force and deported them to Auschwitz Camp. Only fourteen survived. These people were rounded up in the square of the Turtle Fountain. There are some photos on the website. Back to the cobble...