+ # Tags
+ my @tags = $exiftool->GetValue('Keywords', 'ValueConv');
+ $dbh->do('DELETE FROM tags WHERE image=?',
+ undef, $id)
+ or die "Couldn't delete old tag information in SQL: $!";
+
+ my $q = $dbh->prepare('INSERT INTO tags (image,tag) VALUES (?,?)')
+ or die "Couldn't prepare inserting tag information: $!";
+
+ for my $tag (@tags) {
+ $q->execute($id, guess_charset($tag))
+ or die "Couldn't insert tag information in database: $!";
+ }
+