This patch automatically deletes cached images from all presets when the original image no longer exists. This is done scanning each preset and looking for the original image. If it does not exist the cached image is deleted. A new configuration option is added to configure how often to do that.

Without this patch cached images are only deleted manually flushing each preset, which is cumbersone and can overflow busy sites if you forget to do that frequently. Besides that the flush deletes all images, even the ones that still are being used what makes the server rebuild the image.

CommentFileSizeAuthor
#5 imagecache.patch3.44 KBapcal
imagecache.patch2.73 KBapcal

Comments

apcal’s picture

Assigned: apcal » Unassigned
dopry’s picture

Status: Needs review » Needs work

can you provide a unified diff...
see: http://www.drupal.org/patch/create

LeisureLarry’s picture

Subscribe

checker’s picture

are there any experiences with imagecache.patch ?

apcal’s picture

StatusFileSize
new3.44 KB

unified diff attached, as requested

dopry’s picture

Status: Needs work » Needs review

I'd appreciate reviews... I'm working on new 2.x development atm.

tj2653’s picture

subscribing

dopry’s picture

Status: Needs review » Needs work

looking at it _scan_directory should be prefixed with _imagecache to prevent namespace conflicts... Can I get functional reviews from anyone?

dopry’s picture

Version: 5.x-1.3 » 6.x-2.x-dev
Status: Needs work » Postponed

I think this will probably go into imagecache 2.1.... I like the feature... The scan directory should be broken up so it does small chunks at a time... cron will time out otherwiser and we'll never get through the whole dir on large sites... I would also like to merge this with corrupt image detection..

http://drupal.org/node/233691#comment-813844

danny_joris’s picture

This would be great.

The original images get deleted when the node is deleted, but the imagecache files will remain until a manual flush is done. I really like the idea of this being automated. Would this work using cron? I like the idea of clean file folders...

The last comment is exactly 2 years old. What is the status on this? I would love to use this functionality! :)

Cheers,
Danny

fizk’s picture

Status: Postponed » Closed (fixed)

Please reopen if this is still an issue with ImageCache 6.x-2.0-rc1.