If you upload an image with an ampersand (&) in the filename, imagecache will refuse to display the image.
After a bit of investigation I found that imagecache has a problem with a number of special characters in the image filenames.
The solution is a little imagecache theme override in the template.php
Just copy & paste this code to the end of your template.php in the theme folder.
function phptemplate_imagecache($presetname, $path, $alt = '',
$title = '', $attributes = NULL, $getsize = TRUE) {
// Check is_null() so people can intentionally pass an empty array of
// to override the defaults completely.
if (is_null($attributes)) {
$attributes = array('class' => 'imagecache imagecache-'. $presetname);
}
if ($getsize && ($image = image_get_info(imagecache_create_path($presetname, $path)))) {
$attributes['width'] = $image['width'];
$attributes['height'] = $image['height'];
}
$attributes = drupal_attributes($attributes);
// here we add drupal_urlencode to make sure the path is encoded.
$imagecache_url = imagecache_create_url($presetname, drupal_urlencode($path));
return '
';
}
Comments
Think you'll want to have a
Think you'll want to have a look at:
http://drupal.org/project/transliteration
Post new comment