Closed (fixed)
Project:
ImageField
Version:
6.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
5 Apr 2007 at 18:23 UTC
Updated:
25 Mar 2009 at 00:50 UTC
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
Comment #1
quicksketchThe 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.
Comment #2
dopry commentedIs this still applicable? If so lets fix it in 2.1
Comment #3
quicksketchI 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.