if the image size of the icons is defined via the admin screen it is subsequently ignored. The error is n the theming function where the width and height are added as parameters to the theme_image function where they should be added as attributes:

function theme_languageicons_icon($variables) {
  ...
    if ($size = check_plain(variable_get('languageicons_size', '16x12'))) {
      list($width, $height) = explode('x', $size);
      $image += array('width' => $width, 'height' => $height);
    }
  ...

Should be replaced by:

function theme_languageicons_icon($variables) {
  ...
    if ($size = check_plain(variable_get('languageicons_size', '16x12'))) {
      list($width, $height) = explode('x', $size);
      $image['attributes'] += array('width' => $width, 'height' => $height);
    }
  ...

Comments

Freso’s picture

Issue summary: View changes
Status: Needs review » Postponed (maintainer needs more info)

theme_image() accepts the keys width and height directly, not as part of the attributes array: https://api.drupal.org/api/drupal/includes!theme.inc/function/theme_image/7

What is the exact string you have in your size field? Have you checked the HTML output? What theme are you using? Are you using any modules that might override theme_image()?

fietserwin’s picture

Project: Language Icons » Arctica
Version: 7.x-1.0 » 7.x-1.3
Status: Postponed (maintainer needs more info) » Active

It is the Arctica theme that overrides theme image but does not add variables width and height to the attributes.

To solve: in Arctica, file arctica\includes\theme-overrides.inc, add width and height to the array in the foreach statement:

function arctica_image($variables) {
  $attributes = $variables['attributes'];
  $attributes['src'] = file_create_url($variables['path']);

  // we remove width and height attributes
  foreach (array('alt', 'title') as $key) {
    ..
  }
  ...
}