Different sets of language icons per theme I'm using Language Icons and Language Switcher modules. The flag icons are added to the language switcher block, but the icons are stored in sites/all/modules/languageicons/flags. They are of fixed height of 12 pixels by default and they are used by every theme. 

I want to use different sets of flag icons with different dimensions per theme, for example, Theme 1 will use the default icons of 12x12 pixels, but Theme 2 will use the icons of 19x19 pixels. I will have my custom flag icons in my custom module or in my custom themes. 

I would do this by using hook_block_view_alter() to override the block output per theme, but I'm looking for a better and right way.
As mentioned in my question, I could not do this by using hook_block_view_alter() because I can only have the renderable HTML of the block content in that hook.

I found a theme function theme_languageicons_icon, which renders the icons, in the file sites/all/modules/ languageicons/languageicons.module. I copied the theme function into my custom module and implemented hook_theme_registry_alter() to override it.
Then, I updated the function as my need and flushed caches. It gave me exactly what I needed.

function MYMODULE_theme_registry_alter(&amp;$theme_registry){
    if( isset($theme_registry['languageicons_icon']) ){
        $theme_registry['languageicons_icon']['function'] = 'theme_mymodule_languageicons_icon';
    }
}

function theme_mymodule_languageicons_icon($variables) {
  global $theme;
  $language = $variables['language'];
  $title    = $variables['title'];
  # define icons path for various themes
  $default_path = variable_get('languageicons_path', drupal_get_path('module', 'languageicons') . '/flags/*.png');
  $path_by_theme = array(
    'theme1' =&gt; drupal_get_path('theme', 'theme1') . '/flags/*.png'
    'theme2' =&gt; drupal_get_path('theme', 'theme2') . '/flags/*.png'
  );
  $path = (isset($path_by_theme[$theme]) &amp;&amp; file_exists($path_by_theme[$theme])) ? $path_by_theme[$theme] : $default_path;
  # define dimension for various themes
  $default_size = check_plain(variable_get('languageicons_size', '16x12'));
  $size_by_theme = array(
    'theme1' =&gt; '19x19',
    'theme2' =&gt; '25x24',
  );
  $size = (isset($size_by_theme[$theme])) ? $size_by_theme[$theme] : $default_size;

  if ($path) {
    $title = $title ? $title : $language-&gt;native;
    // Build up $image for theme_image() consumption.
    $image = array(
      'path' =&gt; str_replace('*', $language-&gt;language, check_plain($path)),
      'alt' =&gt; $title,
      'title' =&gt; $title,
      'attributes' =&gt; array(
        'class' =&gt; 'language-icon',
      ),
    );
    if ($size) {
      list($width, $height) = explode('x', $size);
      $image += array('width' =&gt; $width, 'height' =&gt; $height);
    }
    return theme('image', $image);
  }
}


If you have a better solution, it is welcome.