On Thu, May 29, 2008 at 9:31 PM, M Sz
<echalone(a)hotmail.com> wrote:
There's a new extension called FileCheck that
probably would be a good idea for wikipedia and/or wikimedia commons!
I noticed that MediaWiki doesn't check back if a file already exists on uploading. Of
course, it checks if a file with the same name already exists, but not the exact same file
even if its saved under another name. So I have written the FileCheck extension. It uses
the SHA1 hashcode MediaWiki saves with every file (since MediaWiki 1.11) in the database.
The extension checks back if the same hashcode is already in the database, and if so,
ckecks back if the already uploaded file and the new file are one and the same. Since the
SHA1 hashcode has an index in the database, it shouldn't be fast enough. If the
extension finds the same file has already been uploaded, it prevents the uploading and
prints out the name and link to the already existing file, along with an error message.
I think this would be a perfect extension to use on wikipedia and wikimedia commons. The
preventing of duplicate uploads is certainly better than the tagging of and searching for
duplicates like it's currently the case.
I think it would be better to integrate this into core, actually. We
aren't using the img_sha1 index at all right now, and this is exactly
what it was meant to do.
As I replied to this email on mediawiki-l, this is already done in
current MediaWiki.
- -- brion
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)
Comment: Using GnuPG with Mozilla -
http://enigmail.mozdev.org
iEYEARECAAYFAkhAJ14ACgkQwRnhpk1wk44rDgCgsz14iFrxLb3ZKYBp/Ft5SY9S
rJsAn2MBZfyl2DMeUmlgt23eo5Ev+mdy
=UN9K
-----END PGP SIGNATURE-----