Purging Obsolete Media Files
Jamroom Developers
"that file" is the hard part. All images that come out on "img src" will first be stored in the cache at /data/cache/(module name).
They will have been put there by processing the master image which is stored with the data at /data/media/(one number)/(another number)/jrAudio_2_image.jpg
something like that ^
That's the image that needs deleting but if you just delete it without deleting the associated datastore entries the system will think it still exists.
So for an image like this one:
your-site.com/blog/image/blog_image/2482/xxxlarge/_v=63f541628547989
its a blog image, its datastore key is 'blog_image' and the datastore _item_id is 2482
Functions that may be useful:
jrCore_get_media_directory
jrCore_get_media_file_url
jrCore_delete_media_file
jrCore_delete_item