In the theme_imagefield_image, theme_imagefield_view_image, and theme_imagefield_view_preview functions, the default for $getsize is TRUE.

This can cause problems when the getimagesize() function fails for some reason. If getimagesize() fails, then no image tag is rendered. For example, I had a series of animated gifs that were breaking under getimagesize(), even though they would display fine in the browser.

I would suggest that the default behavior should be to fail-safe, and set $getsize = FALSE by default.

Alternatively, the default theming behavior could be better structured to handle errors from getimagesize(). I think both solutions have merit.

Comments

quicksketch’s picture

The theme function is modeled after theme_image in core, which sets $getsize=True by default. Correctly handling the image even if it fails is the approach we should probably implement.

dopry’s picture

Version: 5.x-1.1 » 6.x-3.x-dev

Is this still applicable? If so lets fix it in 2.1

quicksketch’s picture

Status: Active » Fixed

I fixed this in this commit: http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/imagefield/...

If getimagesize() fails, the only negative side-effect is that the width and height attributes are not added.

Status: Fixed » Closed (fixed)

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