Removing old unused images

General questions relating to Joomla! 2.5. Note: All 1.6 and 1.7 releases have reached end of life and should be updated to 2.5. There are other boards for more specific help on Joomla! features and extensions.
Locked
maestroc
Joomla! Explorer
Joomla! Explorer
Posts: 404
Joined: Sun Dec 04, 2005 7:27 pm
Contact:

Removing old unused images

Post by maestroc » Tue Apr 16, 2013 4:37 am

Anyone know of a script or program a person could use to:

1) Crawl their site, taking note of all of the images that are asked for
2) Compare that list to the images stored in your images folder
3) Give you a list of the old images that you can safely delete?

I have deleted or archived hundreds of old articles that were not performing well and as a result I know there are now hundreds of dead images in my image directory. I would like to reclaim the space but know of no easy way to do it. Any ideas?

-MaestroC

User avatar
cbahiana
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 185
Joined: Wed Aug 24, 2005 2:03 pm
Location: Rio de Janeiro
Contact:

Re: Removing old unused images

Post by cbahiana » Wed Jan 08, 2014 11:59 am

Hi maestroc,

We are working on exactly that here at the job.

Actually, we're trying to make a code that also ckecks for the existence of images in galleries (we use Simple Image Gallery), system images, thumbnails, caches and leave them untouched.

It will probably not be a Joomla component, but a CLI php, but if we succeed, I'll let you know and share the code.
Carlos Bahiana
You can't always get what you want, but if you try sometimes...

https://www.softdesign.eti.br

User avatar
hans2103
Joomla! Intern
Joomla! Intern
Posts: 78
Joined: Fri Aug 19, 2005 9:21 am
Location: 's-Hertogenbosch, The Netherlands
Contact:

Re: Removing old unused images

Post by hans2103 » Thu Jan 16, 2014 12:12 pm

René Kreijveld already wrote a bash script to take care of this.

jfindfiles
This script looks for used and unused files in the images/stories folder of your Joomla! website. It first creates a database dump and then checks all files in images/stories to see if these are mentioned in the database dump. Reports are created for all used and unused files. Suggestions and improvements are welcome!

http://www.jsnippets.net/snippets/bash/findfiles

It's written for both J1.0 as J1.5
with the code it can be expanded to J2.5 and J3.x
Open Source Consultant at http://www.hkweb.nl HKweb
Signature rules - Literal URL's Only.

User avatar
cbahiana
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 185
Joined: Wed Aug 24, 2005 2:03 pm
Location: Rio de Janeiro
Contact:

Re: Removing old unused images

Post by cbahiana » Thu Jan 16, 2014 12:18 pm

Thanks, Hans, I'll take a look.
Carlos Bahiana
You can't always get what you want, but if you try sometimes...

https://www.softdesign.eti.br

maestroc
Joomla! Explorer
Joomla! Explorer
Posts: 404
Joined: Sun Dec 04, 2005 7:27 pm
Contact:

Re: Removing old unused images

Post by maestroc » Tue Jan 21, 2014 12:52 pm

This would be great if anyone manages to get that script working for 2.5 or 3. Thank you hans for the info and Carlos for looking into upgrading it for 2.5/3.

-Maestroc


Locked

Return to “General Questions/New to Joomla! 2.5”