I can't find this issue.. sorry if it is duplicate...
My imagefield of a CCK node type is displayed correctly in my view using an imagecache preset. awesome..
The problem is that this image field is not required for the content type... and some nodes don't have images defined... then in the views I have an image pointing to the folder of the preset... no image name... (it should not be there) resulting in a "image not found" icon in IE with a red X. In firefox is not displayed any image and nice but annoying in IE displayind that red x icon.
Comments
Comment #1
hedac commentedis there a way to return a specific image if the image field is NULL ?
it could be configured in the imagecache for each preset... as a defalut image if the image is not found... insted of returning a image not found error.
Comment #2
dopry commentedYou can set the imagefield to Required... which is one possible solution.
Regarding 404/403 images.... You can add a 404 or 403 image in the preset folder. This feature is not currenlty documented. I'd look in the source code where 403 and 404 responses are generated to figure out where and how to upload the files. I may complete the UI at some point, but it's not the first thing on my radar currently as I just finished rewriting most of the module.
You may see it in 2.1 or 2.2. I'm currently only working on making sure the module is ready for release. I've halted all new development for the time being, but I would welcome patches.
Comment #3
dezolt384 commentedSame problem with ie7 and Safari, hedac. Did you find a solution?
Comment #4
dodorama commentedI'm experiencing the same problem. It seems that imagecache looks for the image even if there's no image uploaded. I think this is a bug
It's pretty annoying cause it results in a image not found icon in some browsers. Isn't there a way to have imagecache check if an image has been uploaded before to search for it?
My Setup
Drupal 5.7
Imagefield 5.1.1
Imagecache 5.1.3
CCK 5.1.6.1
Comment #5
dodorama commentedI just upgrade to imagefield 5.1.2 RC1 and problems isn't there anymore.
Comment #6
dopry commentedStill need to create a UI to add 403/404 image for presets... not to be confused with default images for fields...
I'm talking more about imagecache/thumbnail/some/image/that/doesn't/exist.jpg
Comment #7
nrudi commentedI'm using imagefield 5.x-2.1 and imagecache 5.x-1.3. The problem can be resolved in one of two ways:
Method 1: Add the following function in template.php
';
function theme_imagecache($namespace, $path, $alt = '', $title = '', $attributes = NULL) {
if (!file_exists($path)) {
return ' ';
}
else {
$attributes = drupal_attributes($attributes);
$imagecache_path = file_create_url(file_directory_path() .'/imagecache/'. $namespace .'/'. $path);
return '
}
}
Method 2: Change the core file imagecache.module to
';
function theme_imagecache($namespace, $path, $alt = '', $title = '', $attributes = NULL) {
if (!file_exists($path)) {
return ' ';
}
else {
$attributes = drupal_attributes($attributes);
$imagecache_path = file_create_url(file_directory_path() .'/imagecache/'. $namespace .'/'. $path);
return '
}
}
PS: return '
does not seem to show up properly in the else {....} statement.
Comment #8
drewish commentedi'm marking this as won't fix since i want to trash the whole 404 403 image feature.
Comment #9
Anonymous (not verified) commentedCan we perhaps discuss this feature? What is the reason you want to trash it?
Personally I run a site with zillions of images, and sometimes there will be defect images.
An imagecache 403 feature could show the default image. I found the (undocumented) 403 featured highly useful.
In imagecache.module:
FIND:
CHANGE TO:
And of course don't forget to create default images in your /files/imagecache/$presetname.403.png location.
Comment #10
Anonymous (not verified) commentedComment #11
fizk commentedPlease reopen if this is still an issue with ImageCache 6.x-2.0-rc1.