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

Time Exposures and the Milky Way

I've learnt to love the effects of slowing down time in a photograph. If I am under a night sky and I just look at the stars there is lots to see, but a time exposure allows the weakest of stars, even those your unaided eyes cannot see, to be recorded by my camera, but this is not as simple as taking a quick snap. The important thing to start with is to understand that the prolonged recording of an image creates the effect one is searching for, but it also brings many problems. The only way to do a time exposure is to leave the shutter open for a set period of time, usually done with a built in timer or by using the Bulb setting and manually or externally controlling the shutter opening time. Most DSLR cameras allow for a maximum open shutter time of thirty seconds, and this is more than enough for Milky Way shots, but often not enough for other types of time exposure. Today I'll just talk about photographing the Milky Way. I like to use a fast lens, that is, one that can o...