In Only local images are allowed. gererated HTML tags, height & width attributes are missing.

CommentFileSizeAuthor
#6 707850-6.patch1.55 KBsrobert72
#4 707850.patch2 KBsrobert72
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

srobert72’s picture

Maybe this function could make it easy to resolve :
http://drupalcontrib.org/api/function/theme_image/6

srobert72’s picture

Or maybe error is here:
file : taxonomy_image.module
line : 286
Code:

    $image[$tid]->img = '<img src="'. $image[$tid]->url
      .'" '. $image[$tid]->tags
      .'alt="'. check_plain($image[$tid]->name) .'" '
      .'title="'. check_plain(($image[$tid]->description ? $image[$tid]->description : $image[$tid]->name))  .'" '
      .'>';

It just doesn't use Height & Width defined above in line 277

    $image[$tid]->width = $img[0];
    $image[$tid]->height = $img[1];
srobert72’s picture

Any latest news ?
Missing width & height attributes is bad for site performance :-(

srobert72’s picture

Status: Active » Needs review
FileSize
2 KB

After many tries, it seems that theme_image function doesn't display $attributes when image URL starts with "http://" and isn't a local image path.

Here is patch, maybe not best one, but it works.

Just for information, I use PageSpeed on my site:
http://code.google.com/speed/page-speed/index.html
After update with this patch I won 5 points in PageSpeed report.

xurizaemon’s picture

Status: Needs review » Needs work

Above patch introduces a new file, '.project'.

Yes, we should use theme('image') IMO. If the image is remote, we don't set the width / height attribs - that's correct behaviour.

srobert72’s picture

Status: Needs work » Needs review
FileSize
1.55 KB

Same patch without ".project" file.
Sorry I didn't seen it, it was generated by Eclipse IDE.