Commons:Village pump/Technical
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/2024/12 /Archive/2025/01.
- Feature or bug reports should be filed on Phabricator (see how to report a bug). Bugs with security implications should be reported differently (see how to report security bugs).
- Have you read the FAQ?
SpBot archives all sections tagged with {{Section resolved|1=~~~~}} after 1 day and sections whose most recent comment is older than 30 days. | |
Sorting audio files by duration
[edit]I'd like to sort audio files not by recency or relevance but by duration (maybe filesize would also work as a proxy for that). Is that possible somehow? I'd like to use it in a category of spoken Wikipedia audios for example to be able to choose between a very long or a shorter audio. It would probably be useful also for many other kinds of applications. Prototyperspective (talk) 16:39, 5 December 2024 (UTC)
- Image duration is not an indexed field in the database I believe. It's only in the db's metadata structure of a file's record, which makes it difficult to query over a collection of files. —TheDJ (talk • contribs) 10:42, 6 December 2024 (UTC)
- I figured maybe it was in the searchindex, but I think it isn't in those indexes either. —TheDJ (talk • contribs) 10:47, 6 December 2024 (UTC)
- But you can sort by filesize from quarry: https://quarry.wmcloud.org/query/88499 —TheDJ (talk • contribs) 10:49, 6 December 2024 (UTC)
- Thanks, that's helpful. However, that's just the filesize, not the duration and I'm looking for something that can be used in the UI (integrated into MediaSearch or SpecialSearch). Strange if it's not in the database since on the file page there is a field "Dimensions" which shows both the file-size and the duration (except for files with this bug). Prototyperspective (talk) 11:11, 6 December 2024 (UTC)
- The file page is just one page, it can descend into the metadata relatively cheaply. Sorting is a 140+ million row operation and for that we need to pre-extract the information and put it into a separate column of the database and keep an index. We do this for width, height and file size, but not for duration. —TheDJ (talk • contribs) 15:54, 10 December 2024 (UTC)
- An extra column for duration like for media width would be very useful then. It would also enable finding & fixing more of the files that display a duration of 0 (and by now I also found a mp3 and an ogg file with that). Prototyperspective (talk) 16:07, 10 December 2024 (UTC)
- And this is where it becomes difficult. Adding a column that for 95% of the files would be empty (because they are NOT audio/video files), is really wasteful for the database. I would ask you to make a Phabricator feature request. And then people can figure out there how to do this. —TheDJ (talk • contribs) 10:32, 6 January 2025 (UTC)
- An extra column for duration like for media width would be very useful then. It would also enable finding & fixing more of the files that display a duration of 0 (and by now I also found a mp3 and an ogg file with that). Prototyperspective (talk) 16:07, 10 December 2024 (UTC)
- The file page is just one page, it can descend into the metadata relatively cheaply. Sorting is a 140+ million row operation and for that we need to pre-extract the information and put it into a separate column of the database and keep an index. We do this for width, height and file size, but not for duration. —TheDJ (talk • contribs) 15:54, 10 December 2024 (UTC)
- Thanks, that's helpful. However, that's just the filesize, not the duration and I'm looking for something that can be used in the UI (integrated into MediaSearch or SpecialSearch). Strange if it's not in the database since on the file page there is a field "Dimensions" which shows both the file-size and the duration (except for files with this bug). Prototyperspective (talk) 11:11, 6 December 2024 (UTC)
Lua error: expandTemplate: template "subst:Custom license marker added by UW" does not exist.
[edit]Is anyone else getting this message on the file pages when using the custom license option on the Upload Wizard? Example at File:(CHN-Shanghai) Pudong Yanggao W0K-114 沪A31192D 581 2024-12-08.jpg. 沪A 05683DS5A-0043 14:08, 8 December 2024 (UTC)
- Someone should batch-remove all 142 instances of
{{self|subst:Custom license marker added by UW}}
after phab:T364150 is fixed. See Template:Custom license marker added by UW for historical context. Dexxor (talk) 12:56, 18 December 2024 (UTC)
Dezoomify and Imperial War Museum images
[edit]I've slowly been requesting overwriting of various files from the IWM. They've been so gracious in correcting exposure on some of those (as I write this, I begin to wonder whether the modifications are enough to warrant copyright protection...), but there being multiple versions of a file seems to confuse Dezoomify, who only pulls the second version with lighting issues. With the help of ChatGPT, I could extract the exposure-corrected one, albeit at a reduced-resolution (1000x1300, compared to the 2400x3000 unedited) version of the edited image. Is there something I'm doing wrong in terms of extracting the edited image in all of its glorious pixels?
The IWM file in question is https://www.iwm.org.uk/collections/item/object/205022125
Here's the ChatGPT convo: https://chatgpt.com/share/67577715-c474-8003-a35e-2456499c0a64
Thanks. JayCubby (talk) 23:12, 9 December 2024 (UTC)
- Similarly, there appears to be a better version of File:John Finnis (captain) 2.jpg (source: https://collections.slsa.sa.gov.au/resource/B+343) at https://collections.slsa.sa.gov.au/resource/B+343/tiles.json
- but Dezoomify isn't working on the code as I'd expect:
Extended content
|
---|
|
JayCubby (talk) 17:07, 10 December 2024 (UTC)
- Hi. If Dezoomify does not yield the desired result, then we have other methods ... First, look at the code for the page. On the page mentioned in IWM, press Shift + Ctrl + i (works in Firefox) to see the code window. In the code window, you should use the "Network" tab. Then click on the desired picture (the one to the left?). You will see three lines of code, one with the "info.json" file that is used by Dezoomify, and two with jpg files that result in thumbs of the picture. If you click on the bottom jpg codeline, you will see this code: https://media.iwm.org.uk/cantaloupe/iiif/2/171%7C%7C950%7C%7Csuper_000000.jpg/full/251,/0/default.jpg
- Now substitute "251" with "2400" and Voila! You get a picture in 2400 x 3111 (at least that is how it worked for me). You might try with larger values than "2400", but the system at IWM would block that option. Hope this helps. Cheers Rsteen (talk) 03:27, 11 December 2024 (UTC)
- Great, I can do that going forward and many thanks! Often images that have been retouched aren't accessible beyond the 2400px, or so I've unreliably figured out after further digging in the source code. JayCubby (talk) 03:53, 11 December 2024 (UTC)
- Interesting. I use the Dezoomify extension on Chrome, and I only get 1536 x 1990 pixels. Please note that this may not be in the public domain. They say "Press agency", not a government picture. Yann (talk) 09:59, 11 December 2024 (UTC)
- Great, I can do that going forward and many thanks! Often images that have been retouched aren't accessible beyond the 2400px, or so I've unreliably figured out after further digging in the source code. JayCubby (talk) 03:53, 11 December 2024 (UTC)
Upload shown as "completed" in OpenRefine, but no upload has been made to Wikimedia Commons
[edit]Background: I am not new to coding and data processing, but to the Wikimedia Commons sphere. I am developing a batch uploading process for the object photographs of a community archive of everyday material culture in Singapore as image sources for their Wikibase Cloud instance (NGO "My Community, Data Partner of Wikimedia Germany, see here). I was sent here by my post on the general Help Desk: https://commons.wikimedia.org/wiki/Commons:Help_desk#OpenRefine_Upload_to_Wikimedia_Commons_failing_without_notice_(abuse_filter_triggered?).
Problem: I have prepared and reconciled all relevant metadata, filenames and filepath in OpenRefine for a test batch of 5 images, including schema preparation with "add media" to Wikimedia Commons. When I did a first technical trial run of the pipeline a month ago, my images successfully uploaded to Wikimedia Commons even though the metadata was far from perfect at the time. Now that I have worked on the data transformation, following the Wikimedia best practices as closely as I could, I have the same thing happening to me as this user here: https://forum.openrefine.org/t/no-errors-reported-and-the-percentage-completed-went-through-but-no-upload-done/899. I get a "100% percent completed" notification from OpenRefine but no uploads have been made (I checked under my user profile as well as searched for the file names).
For reference, see the permalink to my OpenRefine project (hopefully this works!).
What could be the issue? I'd gladly provide more information once I know what is needed here. Thanks! Esxx24 (talk) 22:54, 11 December 2024 (UTC)
- I wanted to start with OpenRefine, too, but it was too complicated for me, so I quit. I think this topic is too unknown that it is covered by several people --PantheraLeo1359531 😺 (talk) 15:21, 31 December 2024 (UTC)
Tech News: 2024-51
[edit]Latest tech news from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. Translations are available.
Weekly highlight
- Interested in improving event management on your home wiki? The CampaignEvents extension offers organizers features like event registration management, event/wikiproject promotion, finding potential participants, and more - all directly on-wiki. If you are an organizer or think your community would benefit from this extension, start a discussion to enable it on your wiki today. To learn more about how to enable this extension on your wiki, visit the deployment status page.
Updates for editors
- Users of the iOS Wikipedia App in Italy and Mexico on the Italian, Spanish, and English Wikipedias, can see a personalized Year in Review with insights based on their reading and editing history.
- Users of the Android Wikipedia App in Sub-Saharan Africa and South Asia can see the new Rabbit Holes feature. This feature shows a suggested search term in the Search bar based on the current article being viewed, and a suggested reading list generated from the user’s last two visited articles.
- The global reminder bot is now active and running on nearly 800 wikis. This service reminds most users holding temporary rights when they are about to expire, so that they can renew should they want to. See the technical details page for more information.
- The next issue of Tech News will be sent out on 13 January 2025 because of the end of year holidays. Thank you to all of the translators, and people who submitted content or feedback, this year.
- View all 27 community-submitted tasks that were resolved last week. For example, a bug was fixed in the Android Wikipedia App which had caused translatable SVG images to show the wrong language when they were tapped.
Updates for technical contributors
- There is no new MediaWiki version next week. The next deployments will start on 14 January. [1]
Tech news prepared by Tech News writers and posted by bot • Contribute • Translate • Get help • Give feedback • Subscribe or unsubscribe.
MediaWiki message delivery 22:21, 16 December 2024 (UTC)
Icons8 svg MIME-type not SVG
[edit]If you install m:User:Tol/RealSVG.js and go to Category:Icons8 flat-icons, you'll see that a ton of the SVGs disappear. Why? According to the W3C checker, their content type is text/plain
! Is there some way to (perhaps check all and) change SVGs content types in bulk? Aaron Liu (talk) 01:02, 17 December 2024 (UTC)
- Validate offline and re upload. Or if they are valid and can be identified easily (by prefix for instance) it might be worth it to run a server side script, but this requires a Phabricator ticket. The cause might be that there is no XML DOCtype declared for these files. —TheDJ (talk • contribs) 12:21, 17 December 2024 (UTC)
- Being more concrete with two example files.
- File:Dam.svg (27 March 2015) does not have an XML processing instruction.
- SVG 1.1 validation gives one error (
version="1"
).
- SVG 1.1 validation gives one error (
- File:Icons8 flat headset.svg (7 March 2016) does not have an XML processing instruction.
- SVG 1.1 validation link fails with
text/plain
. - The file URL produces
text/plain
- https://upload.wikimedia.org/wikipedia/commons/9/95/Icons8_flat_headset.svg
- Request header
:authority: upload.wikimedia.org :method: GET :path: /wikipedia/commons/9/95/Icons8_flat_headset.svg :scheme: https accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7 accept-encoding: gzip, deflate, br, zstd accept-language: en-US,en;q=0.9
- https://upload.wikimedia.org/wikipedia/commons/9/95/Icons8_flat_headset.svg
- https://commons.wikimedia.org/w/api.php?action=query&titles=File:Icons8+flat+headset.svg&prop=imageinfo&iiprop=url%7Cmime%7Cmediatype%7Cmetadata%7Ccommonmetadata%7Cbadfile →
image/svg+xml
- SVG 1.1 validation link fails with
- File:Icons8 flat assistant.svg (7 March 2016) does not have an XML processing instruction.
text/plain
failure.- Did an essentially null edit (change
version="1"
toversion="1.1"
) and the file now validates and displays.
- File:Dam.svg (27 March 2015) does not have an XML processing instruction.
- Glrx (talk) 18:33, 17 December 2024 (UTC)
Image failing to load
[edit]This image, File:Papua New Guinea relief map.svg, is failing to load globally, and I don't see any indication as to why. The image hasn't been modified in a few years, and the image loads from the direct URL ([2]) and from the link on the description page, but doesn't load when it's placed inline. Is this some kind of database error? Ivanvector (talk) 13:55, 19 December 2024 (UTC)
- Bad ns: namespace declaration fixed. Image should appear in a couple hours. Glrx (talk) 19:03, 19 December 2024 (UTC)
- Same problem as #Error with a file above. Glrx (talk) 23:05, 20 December 2024 (UTC)
Template:Q+/doc on Wikispecies
[edit]I imported {{Q+}} and Template:Q+/doc from this project into Wikispecies, but the latter is behaving very oddly, and the former not working as expected, and I cannot figure out why. Wikispecies is a small project with few technical editors; can someone assist there, please? Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 16:07, 19 December 2024 (UTC)
Uploading error
[edit]Hi! It seems that there is a problem during File-uploading here on commons. The page was created for my picture, all descriptions and categories can be seen, but the picture itself is missing. Instead I get following message: "Die Datei „mwstore://local-multiwrite/local-public/1/15/Bargischow_Kirche_lub_2024-07-27_img01.jpg“ befindet sich, innerhalb des internen Speicher-Backends, in einem inkonsistenten Zustand." Is this a known issue, is the issue being resolved, and is there a chance I can add my images to the page without having to go through all the work of describing and categorizing again? Thanks in advance Lukas Beck (talk) 20:03, 23 December 2024 (UTC)
- Hi, I got an error while uploading a big video with Chunked Uploads, and many errors while deleting files. It seems there is some issue on the servers today. Yann (talk) 21:22, 23 December 2024 (UTC)
Issue w/ populating cats by templates
[edit]I used {{US state by city}} to create further subcats of Category:Alaska by city by year. Three days later, those cats are still empty. I don't know much about template programming, but looking over the code, the various by city templates should populate this cat automatically. Please help me out with what missteps may have occurred. RadioKAOS / Talk to me, Billy / Transmissions 23:08, 23 December 2024 (UTC)
- To the best of my knowledge, the by city templates were created via copypasta, so they should have the same syntax and behave the same. Digging further, I wonder if the problem is actually with the above-linked template. Category:2009 in Alaska by city is not populated by the subcats, but does populate Category:2009 in the United States by city by state. OTOH, Category:2010 in Alaska by city is populated by the subcats, but does not populate Category:2010 in the United States by city by state. The former was created by me the other day, while the latter was part of a series created by another editor over three years ago. I haven't examined the breadth of this tree, but the "by city by state" cats for each year appear to be devoid of subcats which should be in there. RadioKAOS / Talk to me, Billy / Transmissions 23:54, 23 December 2024 (UTC)
- The revision history shows it's been edited by @Ricky81682: , @Verdy p: , @AnRo0002: and @SecretName101: . Perhaps you should double-check your edits, as it's apparent the template originally worked correctly but is now broken. I looked over other states' trees in the meantime and the same problem exists. RadioKAOS / Talk to me, Billy / Transmissions 16:09, 24 December 2024 (UTC)
- Looks like a cache issue to me. Category:2010 in the United States by city by state did not have "Category:2010 in Alaska by city" this morning but does now, try doing an edit without any changes on those catgories that are not linked. The edit will not show up in edit history. Snævar (talk) 23:43, 24 December 2024 (UTC)
- I looked at the cat again just now. The Alaska subcat was the only state subcat present, and that's been the case for several days now. For 2010 alone, there also exists 25 other such subcats (California, Colorado, Connecticut, Florida, Georgia, Illinois, Indiana, Iowa, Louisiana, Maryland, Massachusetts, Michigan, Minnesota, Mississippi, Nevada, New Jersey, New York, Ohio, Oregon, Pennsylvania, Rhode Island, Tennessee, Texas, Virginia, Wisconsin). The majority of those subcats had the template added to it within days after it was created in 2021. I don't know if they've been broken for 3+ years or if this is a recent thing. What I do know: I've been clearing my caches as I go along, which hasn't changed anything. I waited several days before originally reporting this in case it was an issue with a database catching up. I tried the null edit and it didn't appear to do anything. The examples I offered don't exist in a vacuum and shouldn't be treated as such. It's clear something is wrong and it appears rooted in the template. There's scores more states, scores more years, and other templates primarily designed to populate cats which aren't doing so. Another example is {{Earthquakes in Alaska}}. I made a simple edit to adjust its position on the tree, but those cats aren't being populated as such. In the future, if the templates' creators and maintainers aren't willing to address the problem, I'll simply comment them out and return to populating the cats by hand until something does change. RadioKAOS / Talk to me, Billy / Transmissions 21:22, 27 December 2024 (UTC)
- I tested just now doing a null edit (an edit without changing anything) on Category:2009 in California by city and it got added to Category:2009 in the United States by city by state. The link gets placed by the California category, not the United States category. I think you may have done a null edit on the United states category, which yes, does nothing. Null edit the subcategory, not the parent. Also there are two caches here, one on your side, and one on the server side. If you do not see California in the United States Category, then clear your client cache (it might be ctrl+F5, maybe something else, it depends on your browser and operating system).
- I then procceded with the other subcats you mentioned, the ones that exist, and now the United States category is at 24 entries. I did not find 4 entries in your list, they showed up as redlinks. If you have more of those, ask a bot operator to help you.
- Waiting for this is going to take ages. I tested this a short while ago, so I know for sure. What happens is that every 30 days - when the server side cache expires, 30 items get added to the category. Also, the link on the subcategory gets added first and then it gets added to the parent a month later. So, if i did not null edit Category:2009 in California by city it would have gotten a link to the Category:2009 in the United States by city by state as the template was added, but California would not be in the United states category until a month later.
- There is absolutely nothing the template can do here, this is a problem with the underlying software, MediaWiki, not the template. File a report on phab:, blaming the template is not going to change anything. I do not care if you will start adding the wikicode yourself without the template. Snævar (talk) 04:55, 28 December 2024 (UTC)
- I looked at the cat again just now. The Alaska subcat was the only state subcat present, and that's been the case for several days now. For 2010 alone, there also exists 25 other such subcats (California, Colorado, Connecticut, Florida, Georgia, Illinois, Indiana, Iowa, Louisiana, Maryland, Massachusetts, Michigan, Minnesota, Mississippi, Nevada, New Jersey, New York, Ohio, Oregon, Pennsylvania, Rhode Island, Tennessee, Texas, Virginia, Wisconsin). The majority of those subcats had the template added to it within days after it was created in 2021. I don't know if they've been broken for 3+ years or if this is a recent thing. What I do know: I've been clearing my caches as I go along, which hasn't changed anything. I waited several days before originally reporting this in case it was an issue with a database catching up. I tried the null edit and it didn't appear to do anything. The examples I offered don't exist in a vacuum and shouldn't be treated as such. It's clear something is wrong and it appears rooted in the template. There's scores more states, scores more years, and other templates primarily designed to populate cats which aren't doing so. Another example is {{Earthquakes in Alaska}}. I made a simple edit to adjust its position on the tree, but those cats aren't being populated as such. In the future, if the templates' creators and maintainers aren't willing to address the problem, I'll simply comment them out and return to populating the cats by hand until something does change. RadioKAOS / Talk to me, Billy / Transmissions 21:22, 27 December 2024 (UTC)
- Looks like a cache issue to me. Category:2010 in the United States by city by state did not have "Category:2010 in Alaska by city" this morning but does now, try doing an edit without any changes on those catgories that are not linked. The edit will not show up in edit history. Snævar (talk) 23:43, 24 December 2024 (UTC)
Force display of graphics without anti aliasing
[edit]Hi! It is common to smooth edges in raster images to make them look more aesthetic to the eye. But sometimes, it is desired not to apply this anti aliasing (for example for small 8-bit graphics). Otherwise it looks blurred. Is there a way to change the display style?
A pixelated arrow looks blurred, which is undesired in this case.
Thanks! --PantheraLeo1359531 😺 (talk) 10:34, 25 December 2024 (UTC)
- The best solution for such cases would be to just use SVG instead. GPSLeo (talk) 13:31, 25 December 2024 (UTC)
- Yeah, I thought about it, too, but I guess there are several (unexperienced) users, who may not take the SVG conversion into account (and batch converting may be complicated, too)... --PantheraLeo1359531 😺 (talk) 14:51, 26 December 2024 (UTC)
EXIF data rendering omits space chars in some contexts
[edit]I raised a similar issue previously and was told the code involved is intricate and quite possibly quirky and that the problem I described is relatively minor — in short, creating a fix is not especially likely. That earlier example involved ␣<
sequences in email addresses.
For context, I specify my JPG metadata using YAML — a language with its own idiosyncrasies — and write that information to file using Python and ExifTool.
My latest upload (see thumbnail) used single quotes preceded (or followed) by spaces in the EXIF::Image Description
metadata field, namely ␣'
. This sequence was rendered faithfully to my terminal by Python and reported correctly on upload and download by both ExifTool and the gThumb image viewer. So I assume that the metadata is stored correctly in the JPG file.
But Wikimedia omits the leading (or trailing) space char in that sequence in the Description field and in the Metadata table. I duly edited the Description field to correct the corrupted string. But the faulty Metadata table rendering cannot be so easily fixed by users.
This presumed bug might not seem important but I can imagine use‑cases where confusion could result. In any case, I am raising the matter in the hope that a fix might be given some increased priority. Best, RobbieIanMorrison (talk) 22:46, 25 December 2024 (UTC)
Another post about GFDL
[edit]Yes, it is another of those posts about GFDL :-) (the other were on main VP)
But the new is that
- There should be no more disclaimers added to any new uploads and all template with disclaimers are now named so it is clear they have disclaimers. See w:en:Wikipedia:GFDL standardization.
- The GFDL update is complete with very few exceptions (mostly files that are suspected to be copysios and fixing a few templates). See Commons:License Migration Task Force/Migration
Per December 27, 2024 there are estimated to be 153,000 files liecensed GFDL outside Commons. Please note that some license templates categorize files in more than one category so some files are counted more than once (mostly screenshots).
Below are categories with more than 1,000 files licensed GFDL as an example.
I could use some help to find the number of files that can't be moved to Commons because the files are not dual-licensed and they are uploaded after 15 October 2018. (They should go in the column "Date issue").
If anyone can think of a good way to automatize the count it would be great. Otherwise I can only think of checking the files manually (if there are only a few files) or with for example https://petscan.wmcloud.org/.
You can see all categories at User:MGA73/GFDL-list and you are very welcome to have a look. MGA73 (talk) 09:50, 28 December 2024 (UTC)
Template: {{Attribs}}
[edit]hi, in this template I miss the line breaks between the individual elements - perhaps somebody can help - for example:
The template also clashes with other content, creating a slight mess
files:
- File:Galicia en común-Anova Mareas logo (color) (Feb. 2020).svg
- File:Blason de la Guyane.svg
- File:Coat of arms of the U.S. 15th Cavalry Regiment with external ornament.svg
- File:Escudo de Francisco González Valer.svg
Mrmw (talk) 11:10, 28 December 2024 (UTC)
Open files uploaded by a user all in new tabs
[edit]How to open x recent files uploaded by a given user in new tabs at once? It takes very long to click all of them. Alternatively, a way to replace a category based on the file title would be great as well but it probably doesn't work as well. Here's what I intend to do:
going through the recent uploads of Florin Talasman to replace category "Agricultural products" with whatever product the map is about which varies per file (e.g. kiwis).
For example, maybe it's possible to output files uploaded by a user with Wikimedia Commons Query Service in a column with the URLs, then select all those URLs (maybe copy pasting it somewhere) and drag them into the Firefox tabs to open them all in new tabs. That didn't work because I could only query for files created by the user but not files uploaded by that user (see also Make it possible to search by page author /contributor/ uploader).
I think this is generally useful, not just for this particular example case. Prototyperspective (talk) 22:58, 28 December 2024 (UTC)
- If you have all the links (e.g. from Special:Log/upload), you can use an extension like Linkclump or [3] to open them all in new tabs. —Mdaniels5757 (talk • contribs) 23:11, 28 December 2024 (UTC)
- I can just drag and drop the URLs once I have them all marked to open them all in new tabs in Firefox. The problem is in getting the plain URLs. Prototyperspective (talk) 23:17, 28 December 2024 (UTC)
for(const d of document.querySelectorAll('.TablePager_col_img_name a:nth-child(1)')) console.log(d.href);
- output https://litter.catbox.moe/2we6sw.txt 999real (talk) 15:19, 31 December 2024 (UTC)
- Is this javascript to be used in the Web console of the recent uploads page (Special:ListFiles) or where? Prototyperspective (talk) 16:49, 31 December 2024 (UTC)
- Yes in console on Special:ListFiles pages
- This one you can save as a bookmark and it will write to clipboard directly
javascript:(function() { navigator.clipboard.writeText(Array.from(document.querySelectorAll('.TablePager_col_img_name a:nth-child(1)')).map(link => link.href).join('\n')) })();
999real (talk) 22:42, 31 December 2024 (UTC)- Thank you! That's very helpful and I guess solves this issue. It should probably be in some relevant Help page so people looking for this functionality can find it. I think one can't filter files to only copy files that are videos of a specified resolution that way (which would be a workaround to solve phab:T377606) so a way to search files uploaded by a given user would still be useful. Prototyperspective (talk) 22:47, 31 December 2024 (UTC)
- I tried write one but Special:ListFiles does not show the resolution directly, this is very slow because it has to load video metadata to fetch the width and height
- Thank you! That's very helpful and I guess solves this issue. It should probably be in some relevant Help page so people looking for this functionality can find it. I think one can't filter files to only copy files that are videos of a specified resolution that way (which would be a workaround to solve phab:T377606) so a way to search files uploaded by a given user would still be useful. Prototyperspective (talk) 22:47, 31 December 2024 (UTC)
- Is this javascript to be used in the Web console of the recent uploads page (Special:ListFiles) or where? Prototyperspective (talk) 16:49, 31 December 2024 (UTC)
- I can just drag and drop the URLs once I have them all marked to open them all in new tabs in Firefox. The problem is in getting the plain URLs. Prototyperspective (talk) 23:17, 28 December 2024 (UTC)
(function() {
function getVideoDimensions(videoUrl) {
return new Promise((resolve, reject) => {
const videoElement = document.createElement('video');
videoElement.src = videoUrl;
videoElement.addEventListener('loadedmetadata', () => {
const width = videoElement.videoWidth;
const height = videoElement.videoHeight;
resolve({ width, height });
});
videoElement.addEventListener('error', (e) => {
reject(`Error loading video: ${e.message}`);
});
videoElement.load();
});
}
const uploads = document.querySelectorAll('.TablePager_col_img_name a:nth-child(2)');
const toCopy = [];
const promises = [];
for (const d of uploads) {
const url = d.href;
if (url.endsWith('.mpg') || url.endsWith('.mpeg') || url.endsWith('.ogv') || url.endsWith('.webm')) {
const promise = getVideoDimensions(url).then(dimensions => {
const minimumWidth = 1000;
const minimumHeight = 720;
if ((dimensions.width < minimumWidth) || (dimensions.height < minimumHeight)) {
toCopy.push(url);
}
}).catch(error => {
console.error(error);
});
promises.push(promise);
}
}
Promise.all(promises).then(() => {
if (toCopy.length === 0) {
alert('Nothing to copy');
} else {
navigator.clipboard.writeText(toCopy.join('\n')).then(() => {
alert('Copied ' + toCopy.length + ' items');
}).catch(err => {
console.error('Failed to copy: ', err);
});
}
});
})();
Then I found VisualFileChange interface actually shows video dimensions, this is much faster
(function() {
const toCopy = [];
const titles = document.getElementsByClassName('jFileTitle');
const dimensions = document.getElementsByClassName('jFileSize');
const minimumWidth = 1000;
const minimumHeight = 1000;
for (let i = 0; i < titles.length; i++) {
const url = titles[i].href;
if (url.endsWith('.mpg') || url.endsWith('.mpeg') || url.endsWith('.ogv') || url.endsWith('.webm')) {
const ds = dimensions[i].textContent.replace(/^.*KiB/, '').replace('px', '');
const width = ds.replace(/^.* x /, '');
const height = ds.replace(/^ x .*/, '');
if((minimumHeight > parseInt(height.replaceAll(' ', ''))) || (minimumWidth > parseInt(width.replaceAll(' ', '')))) toCopy.push(url);
}
}
if (toCopy.length === 0) {
alert('No videos with width below ' + minimumWidth + ' or height below ' + minimumHeight + ' found on this page');
} else {
navigator.clipboard.writeText(toCopy.join('\n')).then(() => {
alert('Copied ' + toCopy.length + ' items');
}).catch(err => {
console.error('Failed to copy: ', err);
});
}
})();
999real (talk) 00:09, 1 January 2025 (UTC)
- @Prototyperspective for this specific case, since what you want can be extracted from the title, you could use com:vfc to batch replace "Category:Agricultural products" with "Category:{{subst:#invoke:String|sub|s={{subst:PAGENAME}}|j=-22}}s", and then fix any possible errors. RoyZuo (talk) 08:30, 1 January 2025 (UTC)
Requesting features on colour blindness acessibility templates
[edit]Hello, I have recently been working on adapting maps and other files to be readable by colour blind users. I'd like to add some (in my opinion, non-controversial) features to a few templates used in this area, but my wikitext comprehension isn't good enough for this. Any help would be greatly appreciated.
The templates I'd like to edit are {{Colour blind accessible}} and {{Colour blind}}. One for marking accessible files, and the other for marking ones that have issues.
There are many image sets that are completely reliant on colour information for highlights, for example in math-related categories (see Category:Planar circle packings; red and blue for an image set without issues). Considering the nature of image sets in Commons, it would be better and easier to maintain if we could add the Colour blind accessible template to image set categories instead of each member individually.
I have managed to add such a parameter to the template above, adding anything to |set=
adjusts the text on the notice box. However I haven't learned conventions for templates localised through autotranslate, and I suspect my implementation breaks good practice by mixing up parameters on the main template with parameters on the subpage ({{Colour blind accessible/en}}).
I'd like to request a once-over on the template from someone more experienced than me, as well as a switch that changes the category inserted by that template from Category:Images accessible to colour blind people to Category:Image sets accessible to colour blind people. Similarly, I'd like to request a feature for using the Colour blind template in categories for image sets, instead of just file pages. I'd be really thankful if anyone could help with this!
P.S. that the category tree for the cats used by these two templates is a bit messy right now because lots of files on it had the category added manually instead of through the template, I'm working on fixing them. Croomfolk (talk) 23:56, 28 December 2024 (UTC)
Umlauts should be sorted to display at the expected place
[edit]For example Ö should display next to O instead of after Z. See e.g. Special:Diff/977365497 by Jochen Burghardt. Umlaut (linguistics).
Could a change to the sorting be made? Prototyperspective (talk) 15:27, 30 December 2024 (UTC)
- No. Category sorting in mediawiki is made with collations. Collations exist for individual languages, but generally not a group of them like latin languages. German Wikipedia can have category sorting designed for German, but there is not a solution for a multilingual wiki like Commons, Wikidata and Meta. You would also get into issues like how to categorize french specific letters next to german ones, in all of the over 100 languages wikimedia commons services with their images. While having a english focused category sorting collation seems very english specific, it really is not, because english has a lot of the basic letters that a lot of latin languages use. The main defect of using english sorting is that it is bad for asian languages. Snævar (talk) 06:56, 31 December 2024 (UTC)
- @Prototyperspective: In addition to what Snævar said, it's apparently close to impossible to make a global change to Commons' category sorting order at all. We asked for a different change to category sorting a few months ago and the WMF sysadmins haven't been able to work out a way to do it without a lot of disruption: phab:T362494. --bjh21 (talk) 09:55, 31 December 2024 (UTC)
- Yeah Commons uses too many Categories. It is running into the limits of what is currently possible. —TheDJ (talk • contribs) 10:59, 31 December 2024 (UTC)
- Would deleting the many empty ones help? Prototyperspective (talk) 11:00, 31 December 2024 (UTC)
- No. As I understand it, the problem isn't really the number of categories, it's the number of category links. That is, the number of connections between categories and members. So an empty category with one parent costs about the same as a file that's in one category. Templates that put millions of files into categories have a much more significant effect. --bjh21 (talk) 11:55, 31 December 2024 (UTC)
- Case in point: Category:Files with coordinates missing SDC location of creation. This category has nearly 17 million members (~15% of all files on Commons); it's responsible for >2% of all category links. Omphalographer (talk) 23:46, 3 January 2025 (UTC)
- No. As I understand it, the problem isn't really the number of categories, it's the number of category links. That is, the number of connections between categories and members. So an empty category with one parent costs about the same as a file that's in one category. Templates that put millions of files into categories have a much more significant effect. --bjh21 (talk) 11:55, 31 December 2024 (UTC)
- Would deleting the many empty ones help? Prototyperspective (talk) 11:00, 31 December 2024 (UTC)
- Yeah Commons uses too many Categories. It is running into the limits of what is currently possible. —TheDJ (talk • contribs) 10:59, 31 December 2024 (UTC)
- In that case a script that changes the sorting of cats starting with ö to o may be useful. how to categorize french specific letters next to german ones right next to them like the umlauts. Prototyperspective (talk) 10:59, 31 December 2024 (UTC)
- Of course, such a script would need to distinguish German from Swedish, where 'ö' sorts after 'z'. --bjh21 (talk) 11:58, 31 December 2024 (UTC)
- I think the internationally/globally reasonable and expectable sorting would be sorting ö after o and è, é, ê, ë after e. That may or may not be the sorting commonly used in English but it doesn't matter much. It doesn't seem like an important issue however. Prototyperspective (talk) 12:38, 31 December 2024 (UTC)
- Of course, such a script would need to distinguish German from Swedish, where 'ö' sorts after 'z'. --bjh21 (talk) 11:58, 31 December 2024 (UTC)
- I wonder if we can borrow some code from English Wiktionary. Is this something you want to replicate? English Wiktionary is multilingual in the sense that they have thousands of German page titles, Spanish page titles, etc. I believe they have a (semi-)automated system based on Lua modules that doesn't need DEFAULTSORT manually written on every page. You do need to specify the language per page through a template, though. whym (talk) 12:54, 31 December 2024 (UTC)
- Interesting, there it's sorted well. Yes, replicating that would be great...above I suggested sorting umlauts separately after the letters but sorting them to be within them may be better (so ö is sorted as if it was o and é as if it was an e). I checked some of the pages and they didn't specify any sorting so it must be implemented differently if I'm not mistaken and I guess one could ask somewhere on wiktionary how it's been done. Prototyperspective (talk) 13:16, 31 December 2024 (UTC)
Issue with restored DjVu files
[edit]Hi, Restored DjVu files do not work, i.e. File:Rothschild Extinct Birds.djvu and first versions of File:Jameson - Montesquieu et l’esclavage.djvu. Any idea? Yann (talk) 17:42, 1 January 2025 (UTC)
- here also. Yann (talk) 18:34, 1 January 2025 (UTC)
- The Rothschild file may just be broken. The other two display fine for me. DjVu files get a thumbnail from ddjvu, which is available for linux, which then sends a PPM file to imagemagick that generates the resulting thumbnail. Either one of those programs failed to read the file. Snævar (talk) 00:15, 5 January 2025 (UTC)
Twinkle
[edit]Hello, I’ve noticed that some files have been created solely for advertising purposes. When I used Twinkle to request speedy deletion under criterion G10, the tool displayed the message: "Tagging page: The edit was disallowed by the edit filter: 'Protect page section headings'." I’m unsure what this means, and in this case, the tool wasn’t able to apply the speedy deletion template. I would greatly appreciate it if you could help clarify this for me. Thank you so much, and have a nice day! P. ĐĂNG (talk) 07:43, 3 January 2025 (UTC)
- You tried to replace the hole page content with the speedy deletion template. All deletion templates have to be added at the first line of the page content and the content must not be removed. GPSLeo (talk) 10:15, 3 January 2025 (UTC)
Autostart imagestack
[edit]Hello! I have animation with the template Template:Imagestack, made out of single files. I would like to know if there is a tag that allows autoplay by opening the cat where it is contained, and how to set the speed. Thanks! --PantheraLeo1359531 😺 (talk) 16:05, 3 January 2025 (UTC)
Sideways upload
[edit]Can anyone explain why File:Cheese (3263135345).jpg was uploaded with a 90-degree rotation, and had to be corrected by a bot? Is it a bug with the upload tool used, Flickr2Commons? Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 15:07, 4 January 2025 (UTC)
- Most likely, conflicting rotation information between the different levels of embedded metadata. —TheDJ (talk • contribs) 10:25, 6 January 2025 (UTC)
Upcoming Commons conversation about tool investment priority on January 15
[edit]Hello everyone! The Wikimedia Foundation will be hosting the third round of a series of community calls to help prioritize support efforts from Wikimedia Foundation for the 2025-2026 Fiscal Year.
The purpose of these calls is to support community members in hearing more from one another - across uploaders, moderators, GLAM enthusiasts, tool and bot makers, etc. - about the future of Commons. There is so much to discuss about the general direction of the project, and we hope that people from different perspectives can think through some of the tradeoffs that will shape Commons going forward.
Our third call will focus on tool investment priority. There are constant calls from the community for the Foundation to adopt community-made tools in order to maintain workflows for the contributors that depend on them. The range of these tools varies widely, and includes media upload (e.g. Video2Commons), editing (e.g. CropTool), curation (e.g. Cat-a-lot) and metrics (e.g. BaGLAMa) tools. Batch upload and metrics tools are said to be critical for the affiliates and Wikimedians in Residence who partner with libraries and other cultural institutions to illustrate Wikipedia. They need to be able to contribute files efficiently at scale, and report on the impact of these contributions. However, community surveys have identified more than 30 different tools that are used for content partnerships.
More specifically the questions will be:
- Does it make sense for the Foundation to invest in supporting the wide range of community-developed tools that don’t have active maintainers, or should a smaller set of critical workflows be enabled through new or improved features in core products?
- Which tool would you recommend to prioritise? Something community-facing or GLAM-facing or video-related or something else?
The call will take place at two different time slots:
- The first one will be on January 15, at 08:00 UTC, and it will be hosted on Zoom by Senior Director of Product Management Runa Bhattacharjee; you can subscribe to it on Meta;
- The second one will be on January 15, at 16:00 UTC, and it will be hosted on Zoom by Chief Product & Technology Officer Selena Deckelmann; you can subscribe to it on Meta.
If you cannot attend the meeting, you are invited to express your point of view at any time you want on the Commons community calls talk page. We will also post the notes of the meeting on the project page, to give the possibility to read what was discussed also to those who couldn’t attend it.
If you want, you are invited to share this invitation with all the people you think might be interested in this call.
We hope to see you and/or read you very soon! Sannita (WMF) (talk) 14:57, 6 January 2025 (UTC)
A "sticky" category
[edit]Hi. Have no idea if this has been discussed before, but how do you remove a "sticky" category? I use the term because I simply can not get rid of the category attached to a file, even though the category is not shown in the edit. The file in question is File:Anonymus Dutch Painter, Maritime view,-circa-1850.jpg. It is clearly marked as belonging to Category:1850s marine paintings, but it also keeps appearing in Category:Marine paintings, resulting in over-categorization. Can anybody explain what is going on? Cheers Rsteen (talk) 15:21, 7 January 2025 (UTC)
- Sorry for the trouble. Just found out that the offending category was looming in an earlier redirected file that had not been properly cleaned up. You (hopefully) learn something every day. Cheers Rsteen (talk) 15:37, 7 January 2025 (UTC)