Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Storing EXIF information in Database

What's the best way to store EXIF data from photos in a Database (MySQL in my case). This is for a photo sharing site.

What are the most important Tags, and what are discardable?

like image 680
The Unknown Avatar asked Jul 01 '09 01:07

The Unknown


People also ask

How is EXIF data stored?

EXIF data is stored embedded into the physical file of the image, and therefore can only be accessed by specific software. The information is removed when a photo is converted to formats other than JPEG, such as PNG or GIF.

Should I keep EXIF data?

If you see a photo on a website that you want to find out more about, you can often access EXIF data if the website is using the original photograph file. But some people prefer to remove the EXIF file before loading their personal images to a website to protect any personal information, like their GPS location.

Where is EXIF metadata stored?

Exif data are embedded within the image file itself. While many recent image manipulation programs recognize and preserve Exif data when writing to a modified image, this is not the case for most older programs. Many image gallery programs also recognise Exif data and optionally display it alongside the images.

What information can be seen within EXIF data?

EXIF data (also sometimes referred to as metadata) contains information such as aperture, shutter speed, ISO, focal length, camera model, date the photo was taken and much more. You can also include copyright information in your EXIF data when you register your camera through the manufacturer.


2 Answers

It's hard for us to determine what is important for you. One approach might be to store all the properties in a table created something like this (approximate SQL syntax):

create table exif_info (
    photo_id integer,
    name varchar,
    value varchar
);

Each row in this table associates one EXIF property with one photo. So you would need a whole bunch of rows to hold all the EXIF properties for a single photo, but this is exactly what relational databases are good at.

In this way, you can store all the available information without having to decide now what might be important later.

like image 192
Greg Hewgill Avatar answered Oct 10 '22 03:10

Greg Hewgill


For your second question...

Picasa

  • Date and time that the photo was taken
  • Camera make & model
  • Resolution
  • Orientation
  • Focal length
  • Aperture
  • ISO speed
  • GPS latitude and longitude

Flickr

  • Camera
  • Exposure
  • Aperture
  • Focal Length
  • ISO Speed
  • Exposure Bias
  • Flash
like image 41
Jorge Zuanon Avatar answered Oct 10 '22 02:10

Jorge Zuanon