Drupal 7 Override Image Alt and Title attributes In Drupal 6 I used the Imagefield Tokens module to set ALT and TITLE tags to default values if not specified (generally the node title).

I'm looking for applying this in Drupal 7, but I am having troubles. I found this thread, but it's a bit inconclusive.

Would it be possible to do this using a template preprocess or a field.tpl.php override?
I think a template preprocess would be fine for this, specifically hook_preprocess_image():

function MYTHEME_preprocess_image(&amp;$vars) {
  // alt
  if (empty($vars['attributes']['alt'])) {
    $vars['attributes']['alt'] = DEFAULT_IMAGE_ALT;
  }

  // title
  if (empty($vars['attributes']['title'])) {
    $vars['attributes']['title'] = DEFAULT_IMAGE_TITLE;
  }
}


Pretty much all images (including those provided by a field) run through theme_image() so this is pretty much the best place for your code.