- # update the last_picture cache as well (this should of course be done
- # via a trigger, but this is less complicated :-) )
- $dbh->do('UPDATE last_picture_cache SET last_picture=GREATEST(last_picture, ?) WHERE event=(SELECT event FROM images WHERE id=?)',
- undef, $datetime, $id)
- or die "Couldn't update last_picture in SQL: $!";
+ for my $key (keys %$info) {
+ next if ref $info->{$key};
+ $q->execute($id, $key, guess_charset($info->{$key}))
+ or die "Couldn't insert EXIF information in database: $!";
+ }
+
+ # update the last_picture cache as well (this should of course be done
+ # via a trigger, but this is less complicated :-) )
+ $dbh->do('UPDATE last_picture_cache SET last_picture=GREATEST(last_picture, ?) WHERE event=(SELECT event FROM images WHERE id=?)',
+ undef, $datetime, $id)
+ or die "Couldn't update last_picture in SQL: $!";
+ }