I've hesitated to make minor adjustments to images uploaded by the new Image plugin for fear of polluting the shared image cache with unused content. Here we explore how we might clean up after such changes.
We configure the Assets plugin to view this site's image cache. Click the link to view an image.
plugins/image
We can discover unused images by updating the Image Caption Survey then running a diff comparing the above list with that found by survey.
diff <(curl -s 'http://photos.ward.dojo.fed.wiki/plugin/assets/list?assets=plugins%2Fimage' | jq -r '.files[]' | sort) <(curl -s 'http://photos.ward.dojo.fed.wiki/image-caption-survey.json' | jq -r '.story[3].survey[].images[].url' | sort | uniq | while read i; do basename $i; done)
This reports discrepancies. A left pointing arrow (<) indicates an unused image in the cache.
35d34 < ff8951b7c8f56c253f15618c2d716fd8.jpg
We can locate, preview and then delete the unwanted image from the Assets plugin above.
# History
Consider that the Journal retains Image items in the edit history that won't be noticed by the survey. When we delete images from the cache, they can't be recalled.
We may choose to revert to earlier history so as to avoid this inconsistency. Realize that Recycled Pages will similarly retain now inconsistent image cache references that are probably best discarded.
# Orphans
The new Image plugin maintains a server wide replica of site specific image caches. A server administrator can locate when this cache holds images that are no longer used based on the hard link use count.
find .wiki/commons -type f -links -2
A confident admin can remove these.
find .wiki/commons -type f -links -2 |\ while read i; do rm $i; done