I am using fupload module and when i delete the node the uploaded files wont be deleted from imagecache!

Comments

pnigro’s picture

I had the same issue. I uploaded three images and had the file names changed to [author-uid].[filefield-extension-original] using the token module. The three file names were then:

1.jpg
1_0.jpg
1_1.jpg

I did this so that I could organize the pictures by author in my directory. I deleted the three images which removed the originals but not the imagecache versions. When I uploaded three new images, the imagecache versions were not created because the file names were the same as the three which were not deleted in the imagecache directory. For [author-uid] the appended number resets after deletion resulting in identical file names in the imagecache directory.

This created a conflict when viewing the images. My thumbnails would be the first uploaded images and the full versions (another imagecache preset) would be the second uploaded images. I am not sure how to fix this but I did find a way to work around it. I changed my file name tokens to [nid].[filefield-extension-original] since every nid is unique.

I hope this helps you.

rout’s picture

I have the same issue. Deleting a node deletes the original image, but not the thumbnail in the imagecache folder.

It looks like these leftover files can be cleaned up by going into Site Building >> Imagecache and flushing the preset. I'm wondering if this should be an automated process?

drewish’s picture

Status: Active » Closed (won't fix)

this is really a problem with the file api in D6. in D7 we'll have the hook_file_delete() so we know when a file was removed and can clean up after it... well actually imagecache will be in core so i won't have to care any more. as far as D6 goes ImageCache has no way of knowing that fupload deleted a file. if fupload wants to call imagecache_file_delete() with the file path then imagecache will clean up after it. sorry totally sucks but that's really what it boils down to.