By kalashari on
Hi,
I set up imagecache to display a thumbnail of a user profile pic in a template like this:
$pic_link = $node->picture;
echo theme('imagecache', 'w40', $pic_link);
that works... BUT, when a user changes his/her profile picture, imagecache DOES NOT update the thumbnail...... only if I flush images from admin/imagecache, it will work fine...
but I donno why it doesn't automatically update on change? Does it matter if pictures are called the same, like for user uid 1, the file name is always "picture-1.jpg" ?
k.
Comments
Lullabot has a fix
Nate Haug at Lullabot built a tutorial and a module to fix this.
call function imagecache_image_flush
probably need to call function imagecache_image_flush($path)
----
Darly
Adding this to a submit
Adding this to a submit handler worked for me when profile pics were getting stuck in the tmp directory, thanks!
I didn't see lulabot's
I didn't see lulabot's module but I corrected this problem in a same way.
In my case, imagecache_image_flush function was bugged so, I changed it to this :
function imagecache_image_flush($path) {
$presets = _imagecache_get_presets();
foreach($presets as $presetid => $presetname) {
// $path = file_directory_path() .'/imagecache/'. $presetname .'/'. $path;
$preset_image = file_directory_path() .'/imagecache/'. $presetname .'/'. $path;
file_delete($preset_image);
}
}
Imagecache not changing profile
Just to be a complete idiot, where do you put that JS snippet? I am havinvg the same problem. like I said, Im an idiot
ImageCache Profiles Module
Try out the ImageCache Profiles module.
Please submit any bug reports or feature requests after giving it a spin.