You are here

function _update_exif_data in Exif 5

Update exif data for a given file.

2 calls to _update_exif_data()
exif_nodeapi in ./exif.module
Implementation of hook_nodeapi().
exif_update_2 in ./exif.install
Add exif for existing images if they exist.

File

./exif.module, line 53

Code

function _update_exif_data($file) {
  $data = _exif_read_exif($file->filepath);
  db_query('DELETE FROM {exif} WHERE fid = %d', $file->fid);

  // Cache data in db.
  foreach ($data as $ifd => $tags) {
    foreach ($tags as $tag => $value) {
      db_query("INSERT INTO {exif} (fid, ifd, tag, value) VALUES (%d, %d, %d, '%s')", $file->fid, $ifd, $tag, $value);
    }
  }
}