Board Thread:Support Requests - Getting Technical/@comment-4224349-20150323211634/@comment-452-20150324215014

So, do you want to just specify a list like: File:image1.jpg File:Much_better_filename.jpg File:image2.jpg File:Another_much_better_filename.jpg

or... something else?

Because there are already batch rename script on http://dev.wikia.com - there's also a duplicate image finder, but it doesn't auto delete, but there is a batch delete script.

In most cases of duplicate images, the duplicates are used, and you'd want to replace the used file with the one you're keeping - so using those existing scripts probably won't cut it.

It would be pretty easy to set up a script to:
 * 1) Use the existing DupImageList script to get the list of dupes
 * 2) Do an API call to get the date each was added, and the list of pages which use them.
 * 3) Replace filenameB with filenameA on all used pages
 * 4) Delete filenameB

However, running it automatically would mean that you might end up replacing well-named newer uploaded files with poorly-named older files, so personally I'd have a "Is this filename okay?" prompt in there. (Personally, I've never had enough dupes uploaded to not just do them manually, but I can see how this could be a problem on a large wiki with many images where no-one has cared about dupes for 8 years.)

edit: Of course, the duplicate image finder only matches exactly identical files, not resized/resaved files. Obviously there are way to "visually" match images, like google does, but I don't know anything about those.