Commons:VPT

Shortcuts: COM:VP/T COM:VPT

Welcome to the Village pump technical section
Technical discussion
Village pump/Technical
 Bug reports
 Code review
Tools
 Tools/Directory
 Idea Lab



This page is used for technical questions relating to the tools, gadgets, or other technical issues about Commons; it is distinguished from the main Village pump, which handles community-wide discussion of all kinds. The page may also be used to advertise significant discussions taking place elsewhere, such as on the talk page of a Commons policy. Recent sections with no replies for 30 days and sections tagged with {{Section resolved|1=--~~~~}} may be archived; for old discussions, see the archives; recent archives: /Archive/2025/06 /Archive/2025/07.

Please note
 
Category:Commons maintenance Category:Commons centralized discussion
SpBot archives all sections tagged with {{Section resolved|1=~~~~}} after 1 day and sections whose most recent comment is older than 30 days.

How to search for text "404" / {{Dead link}} in the Source field?

There was a recent discussion on VP Do we do anything when the source is no longer available? – when I come across a dead or 404 page link in the source field of a file's {{Information}} template, I usually append (404) or (404) next to the link (some examples are in that VP thread). I think some users may have been adding {{Dead link}}.

It would be great if at some point there was a bot that checked links for 404 links. Regardless of whether or not that is being done:

Is there a way to see all files with such links via searching the Information template? Then maybe a bot could go through these and try to add an archived version of the site and human users go through the remaining files to look for an archived or new location of the site or to tag the file somehow.
Relevant once again: How to search the fields of the File information template on Commons?.
Prototyperspective (talk) 14:52, 25 May 2025 (UTC)

I think it could be done somehow using regex and the insource: search operator. Prototyperspective (talk) 16:46, 18 June 2025 (UTC)
This is already done by User:InternetArchiveBot. Wikiwerner (talk) 18:56, 23 June 2025 (UTC)
Thanks for the info! Do you or somebody else know why it doesn't tag many links that are offline - does it have a list of already-checked files and quickly go through new files to check for external links in the source field? In any case, this is just about links that are dead but not websites that are still online but whose contents have disappeared (404) like the examples here (which could be found via some insource search). Prototyperspective (talk) 23:44, 26 June 2025 (UTC)
Be patient ... Wikiwerner (talk) 09:02, 27 June 2025 (UTC)
This bot does not seem to recognize links that are 404 but still online. Prototyperspective (talk) 13:48, 27 June 2025 (UTC)
The examples you supply yield true 404s. Have you got other examples, so I may better understand it? Wikiwerner (talk) 11:23, 30 June 2025 (UTC)
The first example has a 404 page instead of being an offline link. Prototyperspective (talk) 13:19, 28 July 2025 (UTC)
Ah, but if I check the HTTP status code, it is 404. IABot does the same thing. Wikiwerner (talk) 16:51, 28 July 2025 (UTC)

Rotate video

Is there any way to rotate any video files just like we invite a bot to rotate photos. I need to rotate a video 180⁰.––KEmel49talk,Uploads 08:20, 26 June 2025 (UTC)

✓ Done. I did that using external software.––KEmel49 (📝,📤) 07:18, 1 July 2025 (UTC)
There should be a better way, as your file size is now half the size it used to be. Sjoerd de Bruin (talk) 11:54, 1 July 2025 (UTC)
Seems like that's the only thing i stumbled upon, It loses size while converting from .webm to .mp4 then i rotated that and it loses nothing at that process, again loses while converting to .webm. anyway my goal is complete. Hoping for a rotate tool till then.––KEmel49 (📝,📤) 03:17, 10 July 2025 (UTC)

Tech News: 2025-27

MediaWiki message delivery 23:37, 30 June 2025 (UTC)

Remove block notice for notices about unused userpage images etc.

I made a suggestion about removing block warning when the deletion reason is not related to copyright violations her: Template_talk:Speedynote#Block_notice!

But the sandbox system does not agree with me. Perhaps someone can help figure out why it did not work? MGA73 (talk) 07:33, 5 July 2025 (UTC)

I think I fixed it, the switch statement wasn’t working properly before. Tvpuppy (talk) 11:19, 5 July 2025 (UTC)

Hi all,

In File:Santa_Maria_Maggiore,_la_berta.JPG (and others), "Camera model" from EXIF is showing as "[[w:en:Special:Search/<Digimax i50 MP3, Samsung #1 MP3>|<Digimax i50 MP3, Samsung #1 MP3>]]", rather than "Digimax i50 MP3, Samsung #1 MP3". I'm assuming it's due to the presence of "<>" in EXIF - which could safely be ignored. How do we go about fixing this?

Cheers.

Rkieferbaum (talk) 00:36, 7 July 2025 (UTC)

Flickr images undefined licensing

Flickr auto license detector don’t work, user often required to manually to insert {{Flickrreview}} to avoid auto deleted. 6D (talk) 02:00, 7 July 2025 (UTC)

Tech News: 2025-28

MediaWiki message delivery 00:01, 8 July 2025 (UTC)

<inputbox> is directing search queries to Special:MediaSearch

I noticed <inputbox> is directing search queries to Special:MediaSearch rather than Special:Search. This means users much change the "Special:MediaSearch" to "Special:Search" in the URL to do a text search. Can someone please look into this? Ixfd64 (talk) 04:47, 10 July 2025 (UTC)

@Ixfd64 This is a fix to how InputBox works, for this wish. It makes InputBox honour the "Choose your search interface" preference. If you want to use Special:Search, you can change that preference. It defaults to MediaSearch because that's the default for Commons. Sam Wilson 05:05, 10 July 2025 (UTC)
Is there an attribute for <inputbox> to force the use of Special:Search in specific cases?
<inputbox> is currently being used to search archives on pages such as Commons:Administrators' noticeboard and Commons:Village pump. Ixfd64 (talk) 06:01, 10 July 2025 (UTC)
@Ixfd64: I'm afraid I'd not actually taken in that prefix searches don't work in MediaSearch! Sorry, that's quite annoying isn't it. There was a discussion to add a searchengine=Search|MediaSearch parameter, but I argued that it was redundant to the preference, but it sounds like it's really not (or at least, not yet). I've got a patch for that, so will get it back up to date. Sam Wilson 06:50, 10 July 2025 (UTC)
Thank you. This will be very helpful! Ixfd64 (talk) 15:59, 10 July 2025 (UTC)

I see it's merged - should someone add the searchengine=Search parameters now, or is it better to wait until the code is live? Mathnerd314159 (talk) 05:02, 20 July 2025 (UTC)

@Mathnerd314159: Perhaps best to wait till later this week when the new param is available. Just in case there's any issue! Sam Wilson 07:01, 20 July 2025 (UTC)

Bot requests not working?

I've experienced problems trying to file a Bot request - instead of generating a request, the form seems to redirect to a search form. Is this a known issue? Are other users able to reproduce this strange behaviour? Fl.schmitt (talk) 14:25, 11 July 2025 (UTC)

Seems to be a side-effect of phab:T378756, left a notice there. Sjoerd de Bruin (talk) 15:55, 11 July 2025 (UTC)
Indeed, filled phab:T399331. -- CptViraj (talk) 17:08, 11 July 2025 (UTC)

No signature at COM:QIC

Hi!

For some weeks, the automatic signature is not added when I enter the for ~. When I do this in other pages, etc. the automatic input works. How to fix that? Thanks PantheraLeo1359531 😺 (talk) 18:21, 11 July 2025 (UTC)

I didn’t quite understand what you meant, could you explain in more detail? Incall talk 20:57, 27 July 2025 (UTC)

wrong target name at file rename request displayed

On the file page File:Exobasidium giseckiae.jpeg, there is displayed File:Exobasidium gisekiae.jpeg as the rename target, but I put into the template the name File:Exobasidium gisekiae.jpg, as you can see only in the source text. Why is this so? Isn’t it possible to rename a .jpeg file to a .jpg name? (There also is a misspelling in the file name now, it’s not only the extension.) I tried already to put the template new onto the page, then I purged the page and tried a null edit, but nothing works. Therefore I wrote the problem into the template instead. What kind of problem is this? I think that a normal ".jpg" extension would be better, because the file name will be named exactly as the category (it is named this way already except that typo) and to prevent two different files only with the difference ".jpg" vs. ".jpeg" in the extensions in the future. What do others think about that? —176.1.5.162 18:41, 12 July 2025 (UTC)

Looks like they are different formats. Maybe you need to upload a new version? Henrydat (talk) 11:38, 13 July 2025 (UTC)
I don’t think that this can be the reason here. The file had been displayed correctly with .jpeg and now, that it has been renamed correctly by Inertia6084 to the .jpg name, the file still displays correctly on the page. And I can’t see that the renaming user had any problem with renaming it from .jpeg to .jpg. Then it should also be possible that this file name displays correctly on the file page before renaming it. Thus, a new upload wasn’t needed for it.
Ok, it has been renamed, and I still would like to know, why displaying the correct name has been a problem, if anyone has any idea about that. But I think that .jpeg and .jpg are the same format as also .JPG or .JPEG would be, and maybe also .Jpg or .Jpeg or other spellings. If noone has another idea, what can be done in such a case, then this can be archieved after a while, because now after renaming the wrong display of the template can’t be seen anymore. In that case, if noone has another idea, I’ll try that again next time like now with writing the problem into the template. —176.1.3.87 12:52, 13 July 2025 (UTC)
Or if anyone wants to report the problem on Phabricator, then just go ahead. But the problem with that would be to reproduce this error. I don’t know, if the display is a problem every time, someone wants to rename something from .jpeg to .jpg or maybe other extensions. Perhaps it’s better to watch that for a while, if it will occur again. —176.1.3.87 12:59, 13 July 2025 (UTC)
Commons has preferred file name extensions. If you rename to .jpeg, it will automatically use .jpg as the suggested target. —TheDJ (talkcontribs) 09:26, 14 July 2025 (UTC)
That’s good. Then I don’t have to write this into the template anymore. @TheDJ: Thanks for the information. Then the display problem is not so important, but noone will see before renaming on the file page, if the target already exists. What does the software, when such a target name with .jpg already exists and a user hasn’t noticed that before renaming, perhaps because of the display problem? Is the rename then done to another .jpeg name, as the template says? Or does the renaming user get an error message then and the rename isn’t done?
And is this the same when renaming a .JPG or .JPEG file that they both will automatically get .jpg then? .JPG is quite often used, I don’t know what kind of software creates such names. Are there other such combinations and can all preferred file name extensions be read anywhere on Commons? —176.1.19.92 16:20, 15 July 2025 (UTC)

Info: I’ve had some file renames from .JPG to .jpg in the last days. In those cases, the .jpg target was correctly displayed. Perhaps only .jpeg to .jpg or .JPEG to .jpg may be problematic then for the display in the template. Maybe that could be written into the doc page for the template?

@TheDJ: And where can these preferred file name extensions be found? Does there exist any page for it on Commons or elsewhere? —176.1.5.189 18:10, 21 July 2025 (UTC)

Tech News: 2025-29

MediaWiki message delivery 20:05, 14 July 2025 (UTC)

RotateBot not working

The bot has stopped working since June 30, and the backlog in Category:Images requiring rotation by bot is continuing to grow. I left a message at the talk page of @Steinsplitter (owner of the bot), see User talk:Steinsplitter#RotateBot, but it appears they haven't been active since June 25. Is there anything we can do, or do we have to wait for Steinsplitter to fix it? Thanks. Tvpuppy (talk) 00:53, 17 July 2025 (UTC)

Aircraft cat

Hi there. For some reason, {{Aircraft cat}} is self-categorizing lots of categories. Category:Aircraft of Senegal is an example. Could someone with more knowledge than I have solve it, please? Thanks in advance, Alavense (talk) 15:57, 17 July 2025 (UTC)

Error 4914820

Hi! I've used a Python application to upload images for years, and now the API returns the following message:

If you report this error to the Wikimedia System Administrators, please include the details below.

Request served via cp6016 cp6016, Varnish XID 578202189

Upstream caches: cp6016 int

Error: 429, 4914820 at Fri, 18 Jul 2025 13:45:23 GMT

I've tried multiple times for the past few days. Any help appreciated. Thanks, Romainbehar (talk) 19:26, 20 July 2025 (UTC)

I've also been using a Python application for Wikipedia for quite a while without problem until the past few days, where I've also been getting the 4914820 error. What I've noticed is that if I open the URL in my browser, I get the correct results and am not given an error. Panamitsu (talk) 05:50, 21 July 2025 (UTC)
Someone else created a Phabricator ticket for the same issue. API seems to require a user agent now. Romainbehar (talk) 06:49, 22 July 2025 (UTC)
Confirmed! Using Python requests, it works again after adding second line below:
  • session = requests.Session()
  • session.headers['User-Agent'] = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36'
Romainbehar (talk) 18:47, 22 July 2025 (UTC)
It always required a user agent, it's been policy for years. It's just that now there is so much abusive load by AI bots etc, that you are more likely to end up in a rate limit if you didn't specify one. —TheDJ (talkcontribs) 08:24, 24 July 2025 (UTC)

Abkhazia technical puzzler

Selected maps are included in the  Wikimedia Atlas of Abkhazia.


I was trying to debug {{Country category}} and {{Country label}} templates, used by 780k pages and typically maintained by @Joshbaumgartner and Sbb1413: , since those templates seem to be throwing Lua errors in all categories related to Abkhazia. See Category:Abkhazia by topic and Category:Pages with script errors. I see the same errors when running {{Country category |1=Abkhazia}}:

I think the issue is with Wikidata Abkhazia (Q23334) item which for country (P17) lists both Georgia (Q230) and Republic of Abkhazia (Q31354462), and the error states that your template is requesting date from Wikidata item "Q230 and Q31354462". However none of those items changed lately. Some page was changed within the last week to cause all those errors, however I can not find which one. Anyone wants to look at this? Jarekt (talk) 00:45, 21 July 2025 (UTC)

Maybe it’s due to {{Country navbox}}, which has recently been changed? Tvpuppy (talk) 00:34, 22 July 2025 (UTC)
@Tvpuppy: You are right, after undoing changes to {{Country navbox}} template made by User:Verdy p to restore version from 14 April 2025, all errors were resolved. @Verdy p: , I am not sure what issues were being addressed by your changes. Feel free to try again but please test on Category:Abkhazia by topic and similar categories. --Jarekt (talk) 03:53, 22 July 2025 (UTC)
I made a sandbox and tested it, you've removed the support for loading the sandbox (notably in subtemplates)... Basically there are errors that were solved elsewhere (notably loading flag images and other subtemplates), there was no change in structure (just made the code clearer, removed unnecessary HTML comments to hide newlines that are stripped automatically make the editing much easier and clearer; and used rank="best" in queries (instead of two successive tests on "rank=prefered", whcih fails, then without it which loads the incorrect image...), and I added some basic translation. verdy_p (talk) 07:23, 22 July 2025 (UTC)
The obvious error is effectively in Wikidata: Abkhazia is listed has having in TWO *preferred" values for its countries property: itself, and Georgia (this is an error in all cases in the Wikidata item for Abkhazia). After editing the Wikidata item to have only ONE preferred solves the problem. So the real change was not mine in the template, but in the Wikidata item for Abkhazia. If in some corner cases you need to have two preferred values for the same property in the same Wikidata element, my edit or the existing code was not ready for that situation, and the Country box should use smarter queries to avoid such unexpected errors coming from unexpected property values from Wikidata. Your basic revert did not help at all and just broke what was solved elsewhere, because you did not know at all the effective reason. verdy_p (talk) 07:30, 22 July 2025 (UTC)
Wouldn’t it be more suitable to have Republic of Abkhazia (Q31354462) as its preferred value? Since currently it’s displaying the flag of Georgia. Tvpuppy (talk) 09:39, 22 July 2025 (UTC)
The fix I made to add the missing (but required) "numval=1" fixed the issue with categorys related to Abkhazia. However if in some cases you may want to display alternate flags (de facto and de jur), you need further edits to the template (or related modules). For now, the "numval=1" filter is needed (even with the "rank=best" filter), as nothing is ready to accept a (comma-separated) list a values when there are two preferred values returned by the data query. I know no cases where the same item may have two property values with the "rank=preferred" to get an alternate "de facto" flag also displayed in the "Country template" (in addition of the "de jure" which should be the default as it is recognized by hundreds of countries, whereas the regional flag is not recognized as being "national" except by Russia), you need an additional query. Before my change that fixed other cases, there were two successive queries, one using the "rank=preferred" (which could still return two values), and if there was none, a 2nd query without this filter (any values would be returned at any rank, so there was more... including other historical flags).
I've not broken anything in my edit the "Country navbox" template: the bug was already present (since long in Wikidata) even if it was not visible (because pages were not refreshed when the Wikidata item was updated to have two "preferred" values). I have secured the template to make sure the queries returned only one 1 value at most (and not a list), as currently expected. verdy_p (talk) 09:55, 22 July 2025 (UTC)
verdy_p, I do not know much about geography of Abkhazia, but the item Abkhazia (Q23334) is for the territory of Abkhazia, which is split into or claimed by 2 countries, so the Wikidata value was probably correct. Also country (P17) does not have uniqueness constraint, so multiple values there are allowed and our software should not crash because of this. Quite likely at some point someone will notice your "fix" of Q23334 and revert it and than we will be here in the same situation. We had the same issue with {{Wikidata Infobox}} where errors caused by correct but inconvenient Wikidata statements were being fixed by deleting them from Wikidata, which was latter reversed causing recuring problems here, see Template_talk:Wikidata_Infobox#Lua_error. --Jarekt (talk) 13:31, 22 July 2025 (UTC)
There was nothing wrong at all in the template that you reverted. In fact all effectively came from the fact that the template was alling Wikidata which returned a couple of values. This was not detected before, just because the change had occured in Wikidata and was not detected by this wiki that did not update the page (so the bug could have occured at any time, without me changing anything. Now that I've secured the template to make sure that it returns ONLY a single value (and not two in a list),nothing bad can really happen. Still, I have NOT deleted the two values in Wikidata , but only 1 is marked as "preferred" (as needed in Wikidata rules: this was already a violation of Wikidata, and was already reported there); if someone reverts that status in Wikidata, it will still not break this wiki, only one will be used. If one wants to display the two flags (1 for "de jure", the other for "de facto"), we'll still need to change the template to make that correctly without crashing and even if this case we'll still need the "numval=1" filter in addition to the standard "rank=best" filter, by adding another filter to detect "de facto" values and conditionally display this secondary flag and your revert was simply just non-sense: you had not understood the real issue. verdy_p (talk) 13:48, 22 July 2025 (UTC)
Apart from the main topic, disputed territories shouldn't be on the country navigational list (same for South Ossetia, Transnitria, Kosovo). We should treat them separately (as disputed territories in the same template?), otherwise we inherently come to the mentioned conflicts with P17 and other stuff on WD. — Draceane talkcontrib. 14:07, 22 July 2025 (UTC)

Tech News: 2025-30

MediaWiki message delivery 23:38, 21 July 2025 (UTC)

Techniques for YouTube screenshots of people?

Hi all, feel free to tell me to ask this elsewhere! Was wondering if anyone had advice/tips for getting the highest quality screenshots of freely licensed/PD material from YouTube videos, in particular from videos of people speaking/moving. I downloaded and grabbed a screenshot from this video released by the State Department's Art in Embassies program (PD US Gov) to serve as a close-up image of American artist Sam Gilliam. I think I got as high quality a version of the image as I could, but please correct me if you think it could be better. The bigger issue is just capturing a moment where he's not mid-speech or moving his face. I did the tried-and-true quick-unpause-pause method, but I'm not sure I got the best moment. Any tips for this kind of thing?

As an aside, there are a number of very notable artists pictured in this video, could be useful to also have additional images of them on Commons.

Thanks! 19h00s (talk) 15:34, 28 July 2025 (UTC)

I use LosslessCut for downloaded YouTube videos, where you can go frame by frame. In general, images where the motiv is not moving is better, because of less motion blur and potential less compression artifacts :) --PantheraLeo1359531 😺 (talk) 15:36, 28 July 2025 (UTC)
You can step through YouTube videos frame-by-frame using the . and , keys. Omphalographer (talk) 19:41, 28 July 2025 (UTC)
The main problem is that stills from videos are never even close to the quality of real photos. The problem is the long exposure time usually used in video recording. This can not be eliminated when extracting from the original file. Stills from videos should only be used if there is no photo available and it is impossible to take on. GPSLeo (talk) 21:16, 28 July 2025 (UTC)
Well-heard, I definitely agree that high quality still photos are always preferable to video screenshots. Unfortunately this is the best free image I've found so far of Gilliam - we have a very low quality user-sourced image of him on Commons plus two high quality pictures from the State Department where he's either turned away from camera or has his eyes closed. And sadly Gilliam passed away a few years ago so the only photos we have are what's already been created.
Thanks all for the advice! 19h00s (talk) 00:14, 29 July 2025 (UTC)

Tech News: 2025-31

MediaWiki message delivery 00:22, 29 July 2025 (UTC)

Separating maps from other files in a template's categorization

Could somebody make it so that maps are put in a separate category instead of Category:Information graphics without data source by Template:Datasource missing? This would allow excluding these in the GLamorous & Glamorgan scans for file uses which would be very helpful in checking uses of files without datasources – see the links in Help:Misinformation (and one probably needs to check those links first to see why this would be very useful). Maybe this could be done via checking if there is a category containing "maps " on the file or if necessary by splitting the template and doing a VisualFileChange on all the files in it that are maps. Prototyperspective (talk) 13:06, 30 July 2025 (UTC)