Commons talk:Tools/Check-Usage

From Wikimedia Commons, the free media repository
Jump to: navigation, search
Questions, criticism, notes on Check-Usage - this is the discussion page

Known problems[edit]

  • Internet Explorer is not able to flush the buffer until all tables are closed. So you have to wait a loooong time, till something happens. If you have the possibility, use Firefox or Safari or Opera.


Back button (fixed)[edit]

User:Norro requested a back button. I'll add one - until then you can use the back button in your browser. --Avatar 15:19, 23 May 2005 (UTC)

Added. --Avatar 23:14, 28 May 2005 (UTC)

Wiki-Compatible output (fixed)[edit]

Thanks for this great tool! It would be even better if it would (optionally?) produce output ready to be pasted on a wiki page. Instead of

Checking ...

   * Albert Einstein
   * 18. April
   * Wiener-Prozess

Checking ...

   * アルベルト・アインシュタイン
   * Wikipedia‐ノート:ウィキポータル 物理学

I would like to see

 ** [[:de:Albert Einstein]]
 ** [[:de:18. April]]
 ** [[:de:Wiener-Prozess]]
 ** [[:ja:アルベルト・アインシュタイン]]
 ** [[:ja:Wikipedia‐ノート:ウィキポータル 物理学]]

Would you do that? Or give me the source, I'll do it :D -- Duesentrieb 18:10, 28 May 2005 (UTC)

Added. Of course you can have the source - just ask me on IRC. At the moment, it is very dirty, I will clean it up a bit soon. --Avatar 23:14, 28 May 2005 (UTC)

Checking for usage and duplicates at the same time (fixed)[edit]

User:Joolz requested to merge the two functions check usage and check for local duplicates. --Avatar 22:21, 29 May 2005 (UTC)

Done. Now both functions run everytime. --Avatar 14:50, 30 May 2005 (UTC)

Some duplicates are not shown! (fixed)[edit]

User:Joolz wondered why a check for local duplicates on 'Euflag.png' didn't show up the one on

The local Euflag.png on wp-en is ignored because it already has a NowCommons-Template. Because the check for local duplicates is meant to find "accidental" duplicates, all duplicates which have the NowCommons-Template will be ignored. --Avatar 22:21, 29 May 2005 (UTC)

to avoid confusion, it may be best to report tham too but flag them as "already tagged" and maybe show them "grayed out". Whise man sais: never surprise the user!... -- Duesentrieb 22:28, 29 May 2005 (UTC)

User:APPER noticed that some duplicates - without NowCommons-Template - are not found. This is because I check the page for the string "upload.commons"... and the image description page has a GFDL-Template with a gnu head from upload.commons. I'll fix the regexp soon. --Avatar 11:34, 30 May 2005 (UTC)

Now ALL duplicates are shown. --Avatar 14:50, 30 May 2005 (UTC)

A few Interwiki-Links are broken (fixed)[edit]

User:Ezrimerchant noticed that the interwiki-links to some non-wikipedia projects are not correctly formatted (Wikibooks en/de, Wikinews en/de, Wikiquote en/de, Wikispecies). Sad but true, he is absolutly right. --Avatar 21:38, 30 May 2005 (UTC)

All are ok now. --Avatar 5 July 2005 00:04 (UTC)

Please GET the form (fixed)[edit]

Hi - I'd like to suggest to use GET insetad of POST for the from, so the URL contains all parameters. This way, it would be easy to bookmark a query or link to it. -- Duesentrieb 23:45, 31 May 2005 (UTC)

Done. I think this is a good idea. But be aware that the links will get very long because of the list of wp's to check. --Avatar 01:32, 1 Jun 2005 (UTC)
Perhaps you could change the parameters to en.wp, en.wn, de.wq, de.wn etc and just proccess them to convert them back to wikipedia/quote/news? -- Joolz 07:53, 1 Jun 2005 (UTC)
Alternatively, the form could be switched back to POST mode, but the result page could get a "bookmark link", which contains the query in a "compressed format" (like "seach=de,en,en.wk,de.wn,nl.eq" or some such). -- Duesentrieb 15:36, 1 Jun 2005 (UTC)
We are now back to POST. By using a mysql-database, I was able to add a "bookmark" function. It is displayed at the bottom of a search page. --Avatar 23:52, 1 Jun 2005 (UTC)

Linking to the image (open)[edit]

Would it be possible to contain a link to the image for each wikipedia checked? ie, next to de.wikipedia something like (de:Bild:Image.png) which would serve two purposes, for the local duplicates you can see quickly if the local duplicate has changed, and also for people like me who can't quite remember everytime that it's Bild in swedish, Imagem in portugese etc.

A second point which has just occured to me is that the file links are limited to 500, if possible it would be good if the script showed how many links there were for the image on each site.

It's a really great script by the way! -- Joolz 07:58, 1 Jun 2005 (UTC)

Interwikilink format option (open)[edit]

Is it possible to have a third button that leads to pasteable output of the filename without the ":" in front of the iso language code, so that you can copy and paste it easier for use as an interwikilink? --Baikonur 14:08, 1 Jun 2005 (UTC)

It would be even better to just output a block of code that contains interwikilinks to all local description pages (if they exist!) on the different projects. This way, the complete block could be pasted into the image description page on the commons. -- Duesentrieb 15:39, 1 Jun 2005 (UTC)

Allow Image: prefix (fixed)[edit]

I just thought of another small improvement: from the file name, just strip any prefix up the a ":" that way you can have the "Image:" prefix, or "Bild:" or whatever. ":" is not legal in the file name anyway (i think) -- Duesentrieb 23:20, 1 Jun 2005 (UTC)

I also talked with User:FoeNyx about this idea. It's now implemented. (You can strip the prefix or use it like for example Afbeelding:Albert Einstein.jpg). --Avatar 00:45, 2 Jun 2005 (UTC)

File does not exist on commons! (fixed)[edit]

When I searched for copies of Image:Predator's Gold book cover.jpeg the interface refused to go any further and replied "Wise man said: "This filename does not exist on commons.". But it does! It is because of the " ' "? Thuresson 23:24, 1 Jun 2005 (UTC)

Yes, sorry - it's because of the " ' " which gets escaped by the transfer. Fixed now. --Avatar 00:13, 2 Jun 2005 (UTC)

Request to include Estonian Wiki (fixed)[edit]

Hi! This tool is excellent helper. big thanks to you. Would it be possible to add Estonian wiki as well?

it seems that the bar is set to 10 000 articles, as Estonian wiki passed it some time ago, so it should pass the "requirements"(?) :o)
Regards, TarmoK 14:12, 2 Jun 2005 (UTC)

Congrats for breaking the magic barrier. Just added et :-) --Avatar 14:31, 2 Jun 2005 (UTC)
Big thanks for quick work. :o) All the best --TarmoK 14:51, 2 Jun 2005 (UTC)

development thought (open)[edit]

Hi, it's me again :o) I was "playing" a bit around with your tool and came to thought, what about adding one more output option? (you know once you get something, then you want more :o)

So the output would be interwiki list (the links on the left side) of links to wikis where the image from Commons is in use. this way it is possible to copy the output to image page, so everybody can see on which wikis it is in use. I remember vaguely that there have been discussion about it to mark images this way so some eager deleter won't delete without correcting local wiki article first, but I don't remember was there some policy decided or ...

anyway this kind of thought/idea --TarmoK 15:09, 2 Jun 2005 (UTC)

This is the likely the same idea User:Duesentrieb wrote a few lines up ("Interwikilink format option"). But the interwiki list will contain not a list of wikis which use the image (this seems to be of no real use, because the usage will change often), but a list of wikis which have local duplicates. --Avatar 15:53, 2 Jun 2005 (UTC)
first about the wikis which use the image, yes this may change, though not sure will it be often. But I think it is better to have them on picture page as "warning/reminder" that this image is actually in use and making it easier to check are they in use, for people who a not aware of your great tool (unfortunately there are still a lot of them) and may delete images, as you know it isn't "easy" not to say impossible to recover already deleted picture. And if the picture is not in use then it can be seen from picture page in the wiki in question.
about the local dublicates. first I think he had in mind same list as I do, and about dublicates, it's possible to find dublicates when the name is same (and this actually doesn't mean that both files are same by the way) but I know for example in Estonian wiki and I'm sure in other wikis as well, are a lot of files copied from other places and renamed. So for the dublicates i think the work have to be done by "local guys" one by one, by adding NowCommons --TarmoK 13:33, 3 Jun 2005 (UTC)

File really doesn't exist on Commons (fixed)[edit]

Image:Bigcancoat.png was deleted from here. I want to use check-usage to look for pages that used the image, that now might have "missing image" messages. But it refuses to check! Dbenbenn 21:23, 2 Jun 2005 (UTC)

It's only possible to check for duplicates and usage of files which are on commons. This is how the program works:
  • A media file exist on commons.
  • A wikimedia project uses this media file.
  • If you load the project with the media filename, the server returns a page, pointing to commons.
  • Check-Usage uses information (in which article is the file used) from this page.
If you delete the original file from commons, the wikimedia project you check won't return a page pointing to commons. So there is no page which gives information where the file is used throughout this project. So it's not possible to check usage after deleting the file from commons. --Avatar 21:45, 2 Jun 2005 (UTC)
Please see w:Image:thisimagedoesnotexist.png. Although the image does not exist either at the Commons or at the English Wikipedia, MediaWiki helpfully provides a non-empty "File links" section. So, I still believe it should be possible. Or am I misunderstanding? Dbenbenn 07:36, 3 Jun 2005 (UTC)
Ah, looks interesting. I will check this out perhaps next week, thanks for info. Seems with a bit code modification it should be solveable. --Avatar 10:30, 3 Jun 2005 (UTC)
Thanks! In a related issue, if I delete an image from here while check-usage is running, it returns "local duplicate" for the remaining wikis. Dbenbenn 00:19, 4 Jun 2005 (UTC)
The acutal problem, why the program performs a check at first in the Wikimedia Common if the file exists is the reason, that the page of a non existant image has completly different page code and thus the regexps looking for strings don't work as intended (they put out every page as a usage hit). The same problem is in my older check-usage shell script (from which the regexps are inspired for this tool). So the regexps need some thoughts (wich is a little bit tricky as there are always side effects you weren't aware and that only exist at one single random wikipedia language). Arnomane 11:40, 5 Jun 2005 (UTC)

As far as I can tell, the relevant code is exactly the same. In English:

 <h2>File links</h2>
 <p>The following pages link to this file:</p>
 <ul><li> the links appear here

Dbenbenn 16:44, 8 Jun 2005 (UTC)

Check-Usage now also find local duplicates/usage which are not on Commons. --Avatar 17:38, 14 Jun 2005 (UTC)

Use in template (fixed)[edit]

It would be nice to be able to make a template that automatically links to check-usage. We'd need a new URL scheme, though. Something like


which would "check all" with plain output. Then we could use the {{PAGENAME}} variable in, for example, the {{redundant}} template. Dbenbenn 18:49, 3 Jun 2005 (UTC)

I see that this already works, sort of. The default should simply to be to check all Wikis, instead of none. Then
would work, instead of having to use
dbenbenn | talk 16:16, 21 Jun 2005 (UTC)

This now does what you requested - check all projects with plain output. --Avatar 4 July 2005 09:25 (UTC)

Thanks! I don't see what the "&template" is for, but it doesn't matter. dbenbenn | talk 4 July 2005 18:24 (UTC)

allow checking of already deleted images (fixed)[edit]

sometimes a duplicate is deleted with little or no evidence that it was usage checked. i would like the ability to check theese after the fact (currently your tool won't do the check if the image doesn't exist on commons). Plugwash 19:35, 4 Jun 2005 (UTC)

Same as User talk:Tools/Check-Usage#File really doesn't exist on Commons (probably not fixable) above. Dbenbenn 00:52, 5 Jun 2005 (UTC)
Works now. --Avatar 18:37, 14 Jun 2005 (UTC)

not checking for server down (open)[edit]

Hi Avatar. At first: Wow I'm impressed how much you improved my initial idea (I was mostly offline the last days thanks to Arcor that broke my DSL-line). And the web tool was definitly the way to make the usage barrier low enough to be used at large.

There is a small bug in case you get a "Sorry we have a problem..." error. (I wanted to fix it in my script long ago, but I never got the error page when I wanted it, the servers were too stable :p).

  • When the error page ocours at the Wikimedia Commons check of the image you get in return that this image is non existant
  • In case it ocours randomly after that during a check at a lokal Wikimedia project you get a false positive usage.

So we need at every single check a small check for the error page and a small warning to the user in case it happened. E.g something like "Ups Wikimedia server problem, please check again later." Arnomane 13:50, 5 Jun 2005 (UTC)

Usage on Commons (fixed)[edit]

Now will be checked for usage as first project by default. --Avatar 28 June 2005 19:43 (UTC)

Bulk check (fixed)[edit]

You can now check more then one file at the same time. --Avatar 5 July 2005 00:05 (UTC)

Checking Wikimediafoundation (fixed)[edit]

Check-Usage doesn't check Wikimediafoundation. I recently got a complaint for deleting an image that was used there. dbenbenn | talk 7 July 2005 13:19 (UTC)

Well, the problem is - we can't check every single project because there are more than 100. From the language wp's only languages with more than 10,000 articles are added - and the Foundationwiki is really small. But I added it to the list. --Avatar 7 July 2005 14:07 (UTC)
"we can't check every single project because there are more than 100": Your script isn't able to count up to 100? ;) How about adding all Wikimedia projects as options, but leaving the default to only check the reasonably big ones? dbenbenn | talk 7 July 2005 18:23 (UTC)
Hehe, of course it's not a problem to let the script check 100 projects. But it will take a very long time. There should be no problem in adding all projects as options, but than we have to think about which projects should be checked by default (like called from a template). --Avatar 7 July 2005 20:23 (UTC)
really this script is something of a stopgap. someone should really be talking to the developers about a proper soloution. Plugwash
You are right. But there is no thing todo to speed this up besides voting here: --Avatar 8 July 2005 09:50 (UTC)

@dbenbenn: As Avatar noted it already one important point why only the larger projects get checked are performance reasons not to inlcude all existing projects (there is a large number of very small Wikipedia projects). The second even more important point is the database load that would be caused by a full check. As this tool gets used more and more it will definitly have an impact on the wikimedia servers as it generates in short time a lot of requests (of course it only grabs the HTML code and does not load the images itself so the bandwith usage is not the problem but the requests number on the database and apache servers). So in order not to harm the servers a full check was not included out of precaution. Arnomane 7 July 2005 23:03 (UTC) P.S.: If you want to know how the basic principle of this tool work have a look at my now technically outdated shell script at User:Arnomane/Image usage. Arnomane 7 July 2005 23:07 (UTC)

sometimes i get the feeling that making the stopgap cause unacceptable database load may be the only way to persude the devs to do it properly. Plugwash 8 July 2005 14:16 (UTC)
I envision running a complete check of all Wikimedia projects only after I've deleted a redundant image. It's slow and inefficient, but I would only run such a check once. That way I could avoid getting yelled at when working on Category:Redundant.
You could make the user interface for the full check a bit clunky. Say, a new parameter in the URL that you have to enter manually. That would keep people from running the full check frivolously. dbenbenn | talk 9 July 2005 18:55 (UTC)

Adding Check-Usage as image tab (fixed)[edit]

Check-Usage as tab

Ok, this is really nice. Full Credits go to Dbenbenn and Korath. With adding this code to your monobook.js page (which resists right beneath your user-page - if you don't have one yet, just create it) you will get a nice 'check-usage' tab on every picture description page. --Avatar 4 July 2005 10:10 (UTC)

It seems, this won't work for me... I don't see an additional Tab... --Stefan-Xp 21:48, September 10, 2005 (UTC)
The Website seems out of order, too --Stefan-Xp 21:48, September 10, 2005 (UTC)
Well, the monobook.js certainly comes with no warranties! Anyway, what browser are you using? It won't work on Konqueror. dbenbenn | talk 00:30, 11 September 2005 (UTC)
I'm Using Firefox --Stefan-Xp 08:42, September 11, 2005 (UTC)
Works fine for me in Firefox. Did you do Ctrl-F5 after installing User:Stefan-Xp/monobook.js? Are you using the Monobook skin in Special:Preferences? dbenbenn | talk 16:33, 11 September 2005 (UTC)
Yes I done and I'm using Monobook skin --Stefan-Xp 17:26, September 11, 2005 (UTC)
Since today, it works well ;-) --Stefan-Xp 15:49, September 12, 2005 (UTC)

Just wanted to say I've installed this and I look forward to using it frequently. You should advertise it more widely! Maybe I will, for you. :) pfctdayelise 10:22, 19 December 2005 (UTC)

Server down[edit] and Check-Usage has been down the last couple of days. Is this only temporary or has Check-Usage moved to a new web address? Thuresson 14:44, 11 September 2005 (UTC)

Strange. I didn't noticed that (well, I was away the last two days). Because this is also the Server for the city of Juelich and the well known Juelich research center it's pretty unusual to be down - one of the reasons, I have chosen this server for check-usage. And I didn't got a mail or something from dispatch :(. But now it's up and running again. Sorry for inconvenience.--Avatar 05:09, 12 September 2005 (UTC)
PS: Server was down from 09/Sep/2005:23:23:17 +0200 till 11/Sep/2005:17:48:29 +0200.
Again, check-usage was down almost two days. The database backend server had a disk crash :-(. Sorry. The WikiMedia toolserver is up and running, but it still has no database. --Avatar 19:37, 2 October 2005 (UTC)

Mh. Somehow, currently it doesn't work for me; all I get are loads of messages in the format "Checking ... Couldn't resolve host ''(0 matches)". Huh? Nightstallion 11:43, 24 November 2005 (UTC)

Now it's working again. Never mind. ::shrugs:: Nightstallion 11:56, 24 November 2005 (UTC)


I was using Check-Usage to find where Image:M & Emap.jpg is used. However, it seems as if ampersands is not allowed in the search string and what it really was looking for was Image:M_. Correct? Thuresson 05:45, 25 September 2005 (UTC)

I have no problem with checking Image:M & Emap.jpg. dbenbenn | talk 06:18, 25 September 2005 (UTC)
I'll have a look at this. --Avatar 05:42, 26 September 2005 (UTC)

Wrong "Local duplicates"[edit]

While trying to check the usage of Flag of Belgium.svg I got the funny information that there is a local duplicate in the Commons. And, more interestig, it seemed that there were local duplicates in every checked Wikipedia! That wasn't right, of course. Is that a problem with the file type/extension?

--L.m.k 16:54, 12 October 2005 (UTC)

I have noticed that too. Probably a system message the script is looking for has changed. This type of nuisance could be avoided by having a sepcial pseudo-language for bots, see bugzilla:3652. The patch is simple, but got rejected for being "completely the wrong thing to try to do"... maybe, if it got al little support... -- Duesentrieb(?!) 21:47, 12 October 2005 (UTC)

The HTML code in the media description pages changed again:
pre: <div class\=\".*\"><(.*)>
post: <div class\=\".*\" id=\"file\">
I updated the check-usage code - it should work now correct again (hopefully).--Avatar 13:36, 13 October 2005 (UTC)
Check-Usage doesn't seem to be looking for local copies of images. Image:Goths.jpg is available locally at en: and de: but that info doesn't show up. This information is crucial if users upload photos from other wikipedias but forget source and copyright tag. Thuresson 09:33, 16 October 2005 (UTC)
Sigh. That was my fault. Look up:
post: <div class\=\".*\" id=\"file\">
has to be:
post: <div class\=\".*\" id\=\"file\">
(the "=" was not escaped).
Should work now. Sorry :-( --Avatar 09:19, 18 October 2005 (UTC)


Vielleicht ist es ja deinem Tool auch möglich in dieser Art aufgerufen zu werden:

Wenn ja, dann könnte man xyz in einer Vorlage durch die Variable {{{pagename}}} ersetzen um dein Tool vielleicht direkt aus der Werkzeugleiste heraus aufzurufen.

Kolossos 15:13, 24 November 2005 (UTC)

Sorry, ich hatte deinen Beitrag total überlesen. Du kannst Check-Usage doch via aufrufen, oder was meinst du genau? --Avatar 01:31, 1 December 2005 (UTC)

Small changes[edit]

I had to change some matching code. Check-Usage was broken a short time, since the new meta-data feature (more/less javascript-code) is online (the html structure changed in some files). Thanks to Saperaud for bringing it to my attention. Should be fixed now. I hope the database based solution will go online soon. It's not ready yet and also the toolserver went down because of a hardware failure. --Avatar 01:29, 1 December 2005 (UTC)

Adding Lithuanian wikipedia?[edit]

Lithuanian Wikipedia has reached 10000 barier a week ago, so maybe it is possible to include it also? Thanks. Knutux 08:59, 19 December 2005 (UTC)

Just use the new version by Duesentrieb here: -- Duesentrieb(?!) 15:11, 4 February 2006 (UTC) - you can add "lt" as additional wiki. --Avatar 13:04, 26 December 2005 (UTC)

Idea, if your about to delete a file[edit]

I know this should proably go somewhere else, but i don't know where (sorry). How about when you're about to delete a file or if 1 file is redundant you put a watermark on the file saying "This file is about to be deleted, please use $1 instead". Just a thought (proably stupid for a reason i hadn't thought of). Bawolff 05:51, 25 December 2005 (UTC)

This question should go to the Village pump. And we already have something like this, especially for project logos and flags, which are used a lot: Image:Cross.png, Image:Cross.jpg, etc. A Watermark would be nicer, but that's a lot of work for every picture. Or it could be done by the software - in that case, file a feature request on bugzilla. But that wouldn't work for all image formats, I guess... and how about audio files? tricky. -- Duesentrieb(?!) 10:21, 25 December 2005 (UTC)


Wikipedia in Galego has >12000 articles [1]. Should it be included in the search? -- Arcimboldo 05:23, 4 February 2006 (UTC)

It's already included for the new onechanged -- Duesentrieb(?!) 15:10, 4 February 2006 (UTC). ¦ Reisio 09:10, 4 February 2006 (UTC)
thanks, I missed that. Is bulk checking available for the new tool? That help when I want to run a check on all the pictures I've uploaded ;). -- Arcimboldo 14:59, 4 February 2006 (UTC)
Bulk checking is not yet there, but it will be once i get around to it (check again in a few weeks). For more information, see meta:User:Duesentrieb/CheckUsage. Also, please do not use anything under ~daniel/WikiPlay/, use ~daniel/WikiSense/ instead (I changed the URL above). WikiPlay is my personal playground, tools there may suddenly break or return garbage. I'll probably just pull that directory, I don't know how that address ever slipped into the public :/ -- Duesentrieb(?!) 15:10, 4 February 2006 (UTC)

Check Usage is broken[edit]

Folks: for the past week or more, I get a "The page cannot be displayed" page when I try to Check Usage. Is this just my computer? Is someone trying to fix the problem?? Please help. Madman2001 14:12, 20 December 2006 (UTC)

Is there a problem with the tool at the moment? I get errors for enwiki:
“Database Error: Unknown database 'enwiki_p' (sql-s1) on sql-s1/enwiki_p

Failed to connect to DB enwiki_p!

Failed to connect to database for”
Classical geographer (talk) 12:25, 4 August 2009 (UTC)