Enabling the avatars in the comments page is not displayed correctly.
The bug is in managing the size of the avatars in marinelli_preprocess_comment().
A partial fix of this problem is this:

function marinelli_preprocess_comment(&$vars) {
  $vars['classes_array'][] = $vars['zebra'];
  $user_image = array('width' => 0);
  if (isset($vars['user']->picture)) {
    // No.. I don't use style 
    if(!variable_get('user_picture_style')){
      $size = variable_get('user_picture_dimensions');
      $size = explode('x',$size);
      $user_image['width'] = $size[0];
    }
    else{
      //Yes... I use style and it this code not works
      if ($picture = file_load($vars['user']->picture)) {
        $user_image = image_get_info(image_style_path(variable_get('user_picture_style'), $picture->uri)); //always NULL
      }
    }
  }
  $vars['image_width'] = $user_image['width'] + 25;
}


Comments

Lioz’s picture

Hi Uccio (ciao! ;))

i've already posted a possible solution in this similar issue

http://drupal.org/node/1059664

does it work?

Paulbg’s picture

Marinelli 7.x-3.0-beta9
Bug fix works on: IE8 (XP) Firefox 4.0 (XP, Ubuntu) Chrome(Ubuntu) haven't tried other browsers/OS

uccio’s picture

Status: Needs work » Needs review

Hi Lioz,

The problem of this function is that there are 2 possibilities of configuration: Plain image or images with styles.
My patch fix NO styles configuration (my actual configuration) and the http://drupal.org/node/1059664 fix the "STYLES" configuration.

The solution is to Merge the two patch

function marinelli_preprocess_comment(&$vars) {
  $vars['classes_array'][] = $vars['zebra'];
  $user_image = array('width' => 0);
  if (isset($vars['user']->picture)) {
    // No.. I don't use style 
    if(!variable_get('user_picture_style')){
      $size = variable_get('user_picture_dimensions');
      $size = explode('x',$size);
      $user_image['width'] = $size[0];
    }
    else{
      //Yes... I use style
      if ($picture = file_load($vars['comment']->picture->fid)) {
        $user_image = image_get_info(image_style_path(variable_get('user_picture_style'), $picture->uri));
      }
    }
  }
  $vars['image_width'] = $user_image['width'] + 25;
}
Lioz’s picture

Status: Needs review » Fixed

pushed in the next release, thanks Uccio!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.