Finding "Dead" Images in Your Project
Version control has been around in some form for a couple decades now: CVS, SVN, hell, Linus was using tarballs before he invented Git. SCM is vital even to the smallest software projects these days. But we hackers haven’t yet convinced the designers of SCM’s merits. I often inherit projects from other groups with hundreds of old, unused images lying around, unreferenced from any page on the site. They confuse me, and I want to get rid of them.
So here’s a little Perl script that will search your source for references to images in your images directory. By default, it prints the names of those images that aren’t referenced anywhere in the source (you can invert that behavior on the command line). The only intended configuration is specifying lists of file extensions that denote source and image files, but it’s GPL, so have at it.
Have fun, and let me know how it works!