Commons:Village pump/Technical/Archive/2023/07
This is an archive of past discussions. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
Determining a file's filetype in wikitext
i'm thinking of adding cats to {{From YouTube}} so that files are automatically separated into images, videos, etc.
what's an easy way to determine filetype?
here's my idea:
- use Module:string2 to extract the extension (substring from the right to the rightmost dot, like .jpg, .webm).
use parserfunction switch to change extension to filetype.
RZuo (talk) 14:48, 12 July 2023 (UTC)
- There’s already such a template, which works exactly the way you described: {{File type en}}. —Tacsipacsi (talk) 09:07, 13 July 2023 (UTC)
- thx a lot. {{File extension}} is a very neat method.--RZuo (talk) 10:36, 13 July 2023 (UTC)
- where can we find a full list of possible extensions and their corresponding filetype?
- does Template:File type en miss out any extension?--RZuo (talk) 10:36, 13 July 2023 (UTC)
- The list of file extensions that can currently be uploaded can be queried from the API: https://commons.wikimedia.org/w/api.php?action=query&meta=siteinfo&siprop=fileextensions&format=xml. However, be aware that there can be files on Commons that have extensions which used to be but are no longer allowed. These can be found only by going through all file names on Commons, which would take quite a long time even by using a direct SQL query. —Tacsipacsi (talk) 12:34, 15 July 2023 (UTC)
- thx a lot for this neat list.--RZuo (talk) 12:01, 18 July 2023 (UTC)
- The list of file extensions that can currently be uploaded can be queried from the API: https://commons.wikimedia.org/w/api.php?action=query&meta=siteinfo&siprop=fileextensions&format=xml. However, be aware that there can be files on Commons that have extensions which used to be but are no longer allowed. These can be found only by going through all file names on Commons, which would take quite a long time even by using a direct SQL query. —Tacsipacsi (talk) 12:34, 15 July 2023 (UTC)
UK MonthYear template help
Morning all, in my infinite wisdom, I made Template:UKBusmonthyear because I thought it would both aid with navigation throughout a year's worth of bus photos and I thought it would be neat to have a counter per month of how many bus photos were taken without having to step into the year category.
However, I've hit a couple of snags. See, I've based the template off of Template:CountyFermanaghmonthyear (which I'm not exactly sure of the origin template), and in doing so, two issues have cropped up which I've tried and now failed to fix:
- The months in the main year category (i.e. Category:Buses in the United Kingdom photographed in 2023) are all out of order, and,
- In the month in the UK category (i.e. Category:July 2023 in the United Kingdom), the Buses category now appears at the top instead of being filed under the alphabetical 'B' subcategories.
Is there any way I can have help fixing this, and in future, what can I do to prevent it? Hullian111 (talk) 08:29, 18 July 2023 (UTC)
- @Hullian111: i hope you are satisfied with the fix.--RZuo (talk) 12:01, 18 July 2023 (UTC)
Template:Districts of Bangladesh
Hello everyone! I started this template copying Template:Districts of West Bengal. But the code seems not to work. I can't find, where I did the mistake as I am not very familiar with the template structure. Can anyone help to resolve the issue? — Meghmollar2017 • Talk • 16:09, 1 July 2023 (UTC)
Tech News: 2023-27
Latest tech news from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. Translations are available.
Recent changes
- As part of the rolling out of the audio links that play on click wishlist proposal, small wikis will now be able to use the inline audio player that is implemented by the Phonos extension. [1]
- From this week all gadgets automatically load on mobile and desktop sites. If you see any problems with gadgets on your wikis, please adjust the gadget options in your gadget definitions file. [2]
Changes later this week
- The new version of MediaWiki will be on test wikis and MediaWiki.org from 4 July. It will be on non-Wikipedia wikis and some Wikipedias from 5 July. It will be on all wikis from 6 July (calendar).
Tech news prepared by Tech News writers and posted by bot • Contribute • Translate • Get help • Give feedback • Subscribe or unsubscribe.
MediaWiki message delivery 22:49, 3 July 2023 (UTC)
Who is able to fix this template? If you take a look at one of the usages, for example in Category:Charlottenburg-Wilmersdorf in the 1900s, there is a red link in the box and a red category at the bottom. It should be "20th century" instead of "20. century". Thanks -2001:4652:FBAF:0:90A5:4807:B2EE:4427 17:39, 31 July 2023 (UTC)
- I don’t see a red link nor a red category on Category:Charlottenburg-Wilmersdorf in the 1900s. If they’re still there for you, can you say what they link to? Lucas Werkmeister (talk) 18:47, 31 July 2023 (UTC)
- Check it in German: https://commons.wikimedia.org/wiki/Category:Charlottenburg-Wilmersdorf_in_the_1900s?uselang=de-formal (links to Category:Charlottenburg-Wilmersdorf in the 20. century) -2001:4652:FBAF:0:90A5:4807:B2EE:4427 19:41, 31 July 2023 (UTC)
- Okay, I see – I think I’ve fixed it now by adding
|lang=en
to {{Ordinal}}. (CC User:Shāntián Tàiláng who created the template.) Lucas Werkmeister (talk) 21:53, 31 July 2023 (UTC)
- Okay, I see – I think I’ve fixed it now by adding
- Check it in German: https://commons.wikimedia.org/wiki/Category:Charlottenburg-Wilmersdorf_in_the_1900s?uselang=de-formal (links to Category:Charlottenburg-Wilmersdorf in the 20. century) -2001:4652:FBAF:0:90A5:4807:B2EE:4427 19:41, 31 July 2023 (UTC)
Help with {{odate}}
template
Can somebody with experience in templates please edit the {{odate}}
to look and function more like the {{autvec}}
template, because they have similar functions and can be used together. --QuickQuokka [talk • contribs] 20:15, 5 July 2023 (UTC)
Please help rotate
This version - does not rotate with bot. --Abc10 (talk) 13:28, 8 July 2023 (UTC)
- Could you please help rotate it? --Abc10 (talk) 07:27, 9 July 2023 (UTC)
Error from Deletion Notification Bot 2
In this edit, the Deletion Notification Bot 2 made an error of some sort and didn’t created a new section nor did it complete the template. Technical error of some sort. WeatherWriter (talk) 22:32, 9 July 2023 (UTC)
- Looking into it shortly. —Mdaniels5757 (talk • contribs) 00:04, 10 July 2023 (UTC)
- @WeatherWriter Yeah, it looks like your use of the {{Tq}} template broke it. I would fix the bot, but it also broke the tool used to convert speedy nominations to deletion requests, so I think the better solution is just to not use templates inside deletion reasons :). —Mdaniels5757 (talk • contribs) 00:15, 10 July 2023 (UTC)
Tech News: 2023-28
Latest tech news from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. Translations are available.
Recent changes
- The Section-level Image Suggestions feature has been deployed on seven Wikipedias (Portuguese, Russian, Indonesian, Catalan, Hungarian, Finnish and Norwegian Bokmål). The feature recommends images for articles on contributors' watchlists that are a good match for individual sections of those articles.
- Global abuse filters have been enabled on all Wikimedia projects, except English and Japanese Wikipedias (who opted out). This change was made following a global request for comments. [3]
- Special:BlockedExternalDomains is a new tool for administrators to help fight spam. It provides a clearer interface for blocking plain domains (and their subdomains), is more easily searchable, and is faster for the software to process for each edit on the wiki. It does not support regex (for complex cases), nor URL path-matching, nor the MediaWiki:Spam-whitelist, but otherwise it replaces most of the functionalities of the existing MediaWiki:Spam-blacklist. There is a Python script to help migrate all simple domains into this tool, and more feature details, within the tool's documentation. It is available at all wikis except for Meta-wiki, Commons, and Wikidata. [4]
- The WikiEditor extension was updated. It includes some of the most frequently used features of wikitext editing. In the past, many of its messages could only be translated by administrators, but now all regular translators on translatewiki can translate them. Please check the state of WikiEditor localization into your language, and if the "Completion" for your language shows anything less than 100%, please complete the translation. See a more detailed explanation.
Changes later this week
- The new version of MediaWiki will be on test wikis and MediaWiki.org from 11 July. It will be on non-Wikipedia wikis and some Wikipedias from 12 July. It will be on all wikis from 13 July (calendar).
- The default protocol of Special:LinkSearch and API counterparts has changed from http to both http and https. [5]
- Special:LinkSearch and its API counterparts will now search for all of the URL provided in the query. It used to be only the first 60 characters. This feature was requested fifteen years ago. [6]
Future changes
- There is an experiment with a ChatGPT plugin. This is to show users where the information is coming from when they read information from Wikipedia. It has been tested by Wikimedia Foundation staff and other Wikimedians. Soon all ChatGPT plugin users can use the Wikipedia plugin. This is the same plugin which was mentioned in Tech News 2023/20. [7]
- There is an ongoing discussion on a proposed Third-party resources policy. The proposal will impact the use of third-party resources in gadgets and userscripts. Based on the ideas received so far, policy includes some of the risks related to user scripts and gadgets loading third-party resources, some best practices and exemption requirements such as code transparency and inspectability. Your feedback and suggestions are warmly welcome until July 17, 2023 on on the policy talk page.
Tech news prepared by Tech News writers and posted by bot • Contribute • Translate • Get help • Give feedback • Subscribe or unsubscribe.
MediaWiki message delivery 19:51, 10 July 2023 (UTC)
Special:Search no longer displays images in a slideshow
More or less as per title. Clicking on an image result in Special:Search takes you directly to that image's page rather than displaying it in a slideshow as it did previously. Category page slideshows still work, as does the equivalent feature in MediaSearch, so surely this can't be intentional behaviour? - Dvaderv2 (talk) 20:14, 10 July 2023 (UTC)
I have now tried this on different machines and browsers and I'm still getting this issue. Moreover, this testing was done without being logged in, so I can rule this out as being an issue specific to my account. --Dvaderv2 (talk) 17:15, 11 July 2023 (UTC)
F2C
It seems that Flickr2Commons has been shut down as I can't upload even a single file. When I try to enter Flickr file ID to the upload tool it only turns to blue but doesn't upload a file! Юрий Д.К 09:57, 11 July 2023 (UTC)
- i confirm the problem. it's stuck at the blue phase.
- the tool was last working at 13:45, 10 July 2023. RZuo (talk) 13:13, 11 July 2023 (UTC)
- use Special:UploadWizard instead. RZuo (talk) 13:14, 11 July 2023 (UTC)
- Already notified @Magnus Manske: as the creator of F2C. --A1Cafel (talk) 15:11, 12 July 2023 (UTC)
- @Magnus Manske: @RZuo: @A1Cafel: Working now, thanks Юрий Д.К 20:12, 12 July 2023 (UTC)
- Already notified @Magnus Manske: as the creator of F2C. --A1Cafel (talk) 15:11, 12 July 2023 (UTC)
Hi, please help with the problem presented in PHAB:T341636.
Apparently, it affects all editors whose languages are RTL.
—מקףHyphen෴ 14:44, 12 July 2023 (UTC)
Motd/2023-07
Could someone fix the width issue in {{Motd/2023-07}}? Thanks, — Racconish 💬 12:56, 15 July 2023 (UTC)
Search / Skip PDFs / Filemime
While doing searches on Commons, I noticed a 'recent' addition in the form of a link labelled "Skip PDFs", which is slightly easier than adding -pdf to my search string. It has unintended consequences, and I can't find a way to report a bug to the relevant originator. For example, if I enter "deer valley" (with double quotes) in the search box, I get all variations of that. If I then click on the Skip PDFs link, in the search string I then get each double quote mark replaced by ampersand hash 34 semicolon which doesn't produce the intended result. PeterWD (talk) 08:57, 15 July 2023 (UTC)
- Indeed. You might get more help to fix this problem at Commons:Village pump/Technical. -- Asclepias (talk) 15:47, 15 July 2023 (UTC)
- Thanks, but how do I move a discussion without losing formatting, signatures, etc.PeterWD (talk) 08:16, 16 July 2023 (UTC)
- You copy-paste the whole think as wikitext and add a note (usually using <small> for the note, and signing it) to indicate you have done so. - Jmabel ! talk 15:00, 16 July 2023 (UTC)
- Thanks, now moved from Commons:Help desk. PeterWD (talk) 15:28, 16 July 2023 (UTC)
- You copy-paste the whole think as wikitext and add a note (usually using <small> for the note, and signing it) to indicate you have done so. - Jmabel ! talk 15:00, 16 July 2023 (UTC)
- Thanks, but how do I move a discussion without losing formatting, signatures, etc.PeterWD (talk) 08:16, 16 July 2023 (UTC)
- yall need to help pressure some interface sysop to take action for MediaWiki_talk:Searchmenu-new#Skip_pdfs. RZuo (talk) 16:47, 16 July 2023 (UTC)
GalleryDetails doesn't work
MediaWiki talk:Gadget-GalleryDetails.js —מקףHyphen෴ 13:57, 17 July 2023 (UTC)
- Yes, sadly. For a few days now. -- Tuválkin ✉ ✇ 15:24, 17 July 2023 (UTC)
- Is it known what causes this? —מקףHyphen෴ 15:56, 17 July 2023 (UTC)
Tech News: 2023-29
Latest tech news from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. Translations are available.
Recent changes
- We are now serving 1% of all global user traffic from Kubernetes (you can read more technical details). We are planning to increment this percentage regularly. You can follow the progress of this work.
Changes later this week
- The new version of MediaWiki will be on test wikis and MediaWiki.org from 18 July. It will be on non-Wikipedia wikis and some Wikipedias from 19 July. It will be on all wikis from 20 July (calendar).
- MediaWiki system messages will now look for available local fallbacks, instead of always using the default fallback defined by software. This means wikis no longer need to override each language on the fallback chain separately. For example, English Wikipedia doesn't have to create
en-ca
anden-gb
subpages with a transclusion of the base pages anymore. This makes it easier to maintain local overrides. [8] - The
action=growthsetmentorstatus
API will be deprecated with the new MediaWiki version. Bots or scripts calling that API should use theaction=growthmanagementorlist
API now. [9]
Tech news prepared by Tech News writers and posted by bot • Contribute • Translate • Get help • Give feedback • Subscribe or unsubscribe.
MediaWiki message delivery 23:06, 17 July 2023 (UTC)
Old appearance for editor
How do I get back the classic old box for editing with "Publish changes" "Show preview" "Show changes" buttons below "Summary"? Commons help sends to Meta and then MediaWiki and there I choose the "[[]]" option under the eye of Visual Editing in the pencil menu, to no avail. I go to my Preferences and I have legacy Vector 2010 and disabled Visual Editor, but nothing. Any idea? Anything to install? ※Sobreira ◣◥ 〒 @「parlez」 04:02, 30 July 2023 (UTC)
- Perhaps a screenshot (on temporary external source) would better help for understanding. Do you speak of the text being coloured? This would be the syntax highlighting with CodeMirror. This image does show it with Chinese text on zhwiki. — Speravir – 23:36, 1 August 2023 (UTC)
- @Speravir: Oh, thanks, I was off for a while. I mean the box where you write the text, not the text itself. I uploaded the difference:
- ※Sobreira ◣◥ 〒 @「parlez」 00:13, 11 August 2023 (UTC)
- @Sobreira: You need to disable Use the wikitext mode inside the visual editor, instead of a different wikitext editor in Preferences → Editing → Editor. —Tacsipacsi (talk) 15:36, 11 August 2023 (UTC)
- @Tacsipacsi: Oh, thanks, IT'S DONE, I knew it would be some quick detail I was dumb enough not to find. ※Sobreira ◣◥ 〒 @「parlez」 23:12, 12 August 2023 (UTC)
- @Sobreira: You need to disable Use the wikitext mode inside the visual editor, instead of a different wikitext editor in Preferences → Editing → Editor. —Tacsipacsi (talk) 15:36, 11 August 2023 (UTC)
- ※Sobreira ◣◥ 〒 @「parlez」 00:13, 11 August 2023 (UTC)
Commons:File types needs update
Commons:File types says mpeg is a "Nonfree file format", but some uploads are in this format? e.g. File:4U 1820-30.mpeg, File:Pantun berlirik a-a-a-a.mpg. i have no knowledge about this issue so i dont know how to rewrite the help page. RZuo (talk) 12:13, 18 July 2023 (UTC)
- MPEG uploads have been enabled three years ago, after last MPEG patents expired in February 2018. So Commons:File types used to be correct, but isn’t anymore. —Tacsipacsi (talk) 00:58, 19 July 2023 (UTC)
- I've updated it in English, German, French, and Spanish. The Squirrel Conspiracy (talk) 03:10, 19 July 2023 (UTC)
Motion Picture Copyright Descriptions Collection, 1912-1977
- search: site:tile.loc.gov/storage-services/service/mbrs/cdmmi/ filetype:pdf
- I do not know to find the meta data URLs
- Many Public domain scripts, press sheets, other
- can acquisition be automated?
- .... 0mtwb9gd5wx (talk) 16:26, 22 July 2023 (UTC)
Tech News: 2023-30
Latest tech news from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. Translations are available.
Recent changes
- On July 18, the Wikimedia Foundation launched a survey about the technical decision making process for people who do technical work that relies on software that is maintained by the Foundation or affiliates. If this applies to you, please take part in the survey. The survey will be open for three weeks, until August 7. You can find more information in the announcement e-mail on wikitech-l.
Changes later this week
- The new version of MediaWiki will be on test wikis and MediaWiki.org from 25 July. It will be on non-Wikipedia wikis and some Wikipedias from 26 July. It will be on all wikis from 27 July (calendar).
Tech news prepared by Tech News writers and posted by bot • Contribute • Translate • Get help • Give feedback • Subscribe or unsubscribe.
MediaWiki message delivery 02:18, 25 July 2023 (UTC)
Quickfix needed for wrongly rotated file (exif error)
Hi this file shows up right in crop/rotation tool but wrong in description page. Original rotation was wacky in exif and this showed in the loading of the image from right to left. How to fix this and similar halfway incorrect rotations? Thanks. Similar issues from those days in crop tool vs. descr. page. Peli (talk) 22:10, 24 July 2023 (UTC)
- Fixed visual part of this case. Peli (talk) 10:57, 25 July 2023 (UTC)
Nie mogę podmienić zdjęcia.
Dobry wieczór. Chciałem podmienić fotografię własnego autorstwa: [10] na inną w lepszej jakości, ale wyskakuje mi komunikat: "If you do not provide suitable license and source information, your upload will be deleted without further notice. Thank you for your understanding". Wbrew temu co mówi komunikat nigdzie nie widzę rubryki na wstawienie jakiejkolwiek informacji licencji fotografii. Prosiłbym o pomoc w tej sprawie. KujKuń (talk) 22:16, 25 July 2023 (UTC)
Annoying confirmation step
When I'm on a Commons file description page, and click on a link, I often (but not always) get a popup as follows:
This page is asking you to confirm that you want to leave — information you’ve entered may not be saved.
Leave page Stay on page
I could understand this happening if I was editing the page at the time, but it can happen even when I click the first link on Commons having just arrived from Wikipedia, before I click an edit link. It happens most often when I click the "Original file" link to view the full-size image, but also happens for e.g. links to other files, or category links. It even happens when I click the "Edit" tab. It only happens on Commons but not on other WMF wikis.
Is this a commons feature, or a browser feature? I use Firefox, presently version 115. Is there any way of circumventing it so thT I don't have to keep on clicking that "Leave page" button? --Redrose64 (talk; at English Wikipedia) 13:13, 22 July 2023 (UTC)
- This topic was brought up in the discussions earlier with no real outcome for a solution as far as i can remember. Someone checked ... and found ... was still open. Nowadays I (go back &) stay a moment longer on the page and than leave it without the popup, in the hope this fixes this issue for that page for others too. Peli (talk) 19:06, 22 July 2023 (UTC)
- I found a persistant one here. Shows the alert upon leaving page Peli (talk) 23:27, 25 July 2023 (UTC)
- I have the same problem in Firedox 102.13.0 on Mac when I select a piece of text and then want to leave the page. No problem with Safari 16.5.2. Wouter (talk) 20:33, 28 July 2023 (UTC)
- I found a persistant one here. Shows the alert upon leaving page Peli (talk) 23:27, 25 July 2023 (UTC)
How to deal with seemingly unused gadgets needing an update
There are still some gadgets that have now outdated code after changes according to phab:T314318, see also corresponding FAQ: mw:Parsoid/Parser Unification/Media structure/FAQ #The "image" class is no longer present on file description links.
Some used gadgets already have been updated, but these haven’t yet:
- MediaWiki:FileContentsByBot.js (points to Template:FileContentsByBot)
- MediaWiki:GalleryPicker.js
- MediaWiki:Gadget-NSFW.js
The first one is mentioned in a comment in User:DrTrigon/common.js, but this user is inactive since 2016.
What I cannot estimate, though, are potential external uses. — Speravir – 23:22, 29 July 2023 (UTC)
Tech News: 2023-31
Latest tech news from the Wikimedia technical community. Please tell other users about these changes. Not all changes will affect you. Translations are available.
Recent changes
- The Synchronizer tool is now available to keep Lua modules synced across Wikimedia wikis, along with updated documentation to develop global Lua modules and templates.
- The tag filter on Special:NewPages and revision history pages can now be inverted. For example, you can hide edits that were made using an automated tool. [11][12]
- The Wikipedia ChatGPT plugin experiment can now be used by ChatGPT users who can use plugins. You can participate in a video call if you want to talk about this experiment or similar work. [13]
Problems
- It was not possible to generate a PDF for pages with non-Latin characters in the title, for the last two weeks. This has now been fixed. [14]
Changes later this week
- The new version of MediaWiki will be on test wikis and MediaWiki.org from 1 August. It will be on non-Wikipedia wikis and some Wikipedias from 2 August. It will be on all wikis from 3 August (calendar).
- Starting on Tuesday, a new set of Wikipedias will get "Add a link" (Georgian Wikipedia, Kara-Kalpak Wikipedia, Kabyle Wikipedia, Kabardian Wikipedia, Kabiyè Wikipedia, Kikuyu Wikipedia, Kazakh Wikipedia, Khmer Wikipedia, Kannada Wikipedia, Kashmiri Wikipedia, Colognian Wikipedia, Kurdish Wikipedia, Cornish Wikipedia). This is part of the progressive deployment of this tool to more Wikipedias. The communities can configure how this feature works locally. [15]
Tech news prepared by Tech News writers and posted by bot • Contribute • Translate • Get help • Give feedback • Subscribe or unsubscribe.
MediaWiki message delivery 23:52, 31 July 2023 (UTC)
Thumbnail displays in special search results shown as squares again ?
Hello the thumbnails in special search results are back to squares for me. I thought we had agreed that this is hindering the oversight and that this new layout was rolled back or disabled generally for commons. lengthy discussion here the big code block with css hack shown there was added to my common.css but stopped working for me since ca. 14 days. What's up with this? In a way the square previews look smooth as a page ... but it hinders mass-reviewing subtle things like sloppy crops around the edges as the discussion shows in examples. And why 'castrate the integrity of each and every image' and discard the basic notion of landscape vs portrait format? So again : how to opt out, please. Thanks. Peli (talk) 19:15, 20 July 2023 (UTC)
- I confirm this is happening, to me too, even with the hack added to User:Tuvalkin/common.css. (The one to suppress thumbnails for cats is working, though. -- Tuválkin ✉ ✇ 01:02, 22 July 2023 (UTC)
- Like just about anything that broke on Commons two weeks ago: phab:T314318, specifically mw:Parsoid/Parser Unification/Media structure/FAQ#The "image" class is no longer present on file description links. Replacing
.image
with.mw-file-description
should help. —Tacsipacsi (talk) 22:49, 22 July 2023 (UTC)- Perfect, it works! -- Tuválkin ✉ ✇ 04:56, 23 July 2023 (UTC)
- Yes, confirmed. This hack works. Maybe it should be the default thumbnail layout for everyone on commons or at least be added as an option in user preferences. Thanks Peli (talk) 08:52, 28 July 2023 (UTC)
- Moving it to an (opt-in) gadget should be feasible, both technically and organizationally (I fear WMF would object to changing the default), good idea! Unfortunately I can’t do it myself. Hopefully an interface administrator will notice this; if not, you could ping one of them. —Tacsipacsi (talk) 16:13, 28 July 2023 (UTC)
- Maybe @Raymond: can help getting this proposal to be installed as an opt-in preference for logged-in users by the tech-team. Eventhough I would not know why other users would only need to see 1/4 of the thumbs in their special-search results. Peli (talk) 16:50, 8 August 2023 (UTC)
- @Pelikana Technically I could do. But I am not sure about the process to enable new gadgets. I would propose to ask on Commons:Administrators' noticeboard Raymond (talk) 17:47, 8 August 2023 (UTC)
- Ok thank you for the response. Maybe I will wait until the yearly tech wishlist is open again. It's not clear to me why these square thumbs are preferred by the layout team, and set as a default, over just showing complete thumbs. Peli (talk) 18:05, 8 August 2023 (UTC)
- @Pelikana Technically I could do. But I am not sure about the process to enable new gadgets. I would propose to ask on Commons:Administrators' noticeboard Raymond (talk) 17:47, 8 August 2023 (UTC)
- Maybe @Raymond: can help getting this proposal to be installed as an opt-in preference for logged-in users by the tech-team. Eventhough I would not know why other users would only need to see 1/4 of the thumbs in their special-search results. Peli (talk) 16:50, 8 August 2023 (UTC)
- Moving it to an (opt-in) gadget should be feasible, both technically and organizationally (I fear WMF would object to changing the default), good idea! Unfortunately I can’t do it myself. Hopefully an interface administrator will notice this; if not, you could ping one of them. —Tacsipacsi (talk) 16:13, 28 July 2023 (UTC)
- Yes, confirmed. This hack works. Maybe it should be the default thumbnail layout for everyone on commons or at least be added as an option in user preferences. Thanks Peli (talk) 08:52, 28 July 2023 (UTC)
- Perfect, it works! -- Tuválkin ✉ ✇ 04:56, 23 July 2023 (UTC)
- Like just about anything that broke on Commons two weeks ago: phab:T314318, specifically mw:Parsoid/Parser Unification/Media structure/FAQ#The "image" class is no longer present on file description links. Replacing
RSVG rendering preview on user:Rillke/MwJSBot.js not working
When I preview any SVG using User:Rillke/MwJSBot.js, I don't get the RSVG rendering preview to work. It just shows the default File:Bug blank.svg as if the SVG is broken, but they aren't. Am I the only one having this problem? Jonteemil (talk) 16:48, 23 July 2023 (UTC)
- Anyone? Jonteemil (talk) 14:48, 28 July 2023 (UTC)
- @Glrx: Can you confirm or disconfirm this? Jonteemil (talk) 19:11, 2 August 2023 (UTC)
- @Jonteemil and Rillke:
- I've been using User:Rillke/SVGedit.js for a time, but I have not paid much attention to the RSVG rendering. I usually do not hit the preview button. When I do, I'm happy to see a local SVG rendering. RSVG departs from the SVG specification in a few places.
- The RSVG preview has not worked in a long time. For example, using SVGedit on File:IPv6 header-en.svg (which specifies a width and height) does not produce an RSVG preview.
- If I look at the SVGedit code, line 396 does a
fetchPreview(val)
. I presume that obtains the RSVG rendering. That method probably fails, so line 413 substitutes a PNG rendering of File:Bug blank.svg. (An alternative explanation is the preview method succeeds but line 399image/jpeg
is incorrect and causes a failure. I expect RSVG to return animage/png
rather than animage/jpeg
. Data URL claims JPEG but is PNG. Another possibility is the line 411 timeout is too short.) - Looking further,
fetchPreview
sends its request to//convert.toolforge.org/svg2png.php
. If I go to that website and issue a request for a large (2199×1477) SVG file, I get a 500 Internal Server Error. If I give it a small file, my computer receives a appropriate PNG. I will guess the endpoint functions for at least some files. - That leads me back to guessing something goes wrong inside of line 397
.done
. - Glrx (talk) 20:51, 2 August 2023 (UTC)
- @Glrx: Okay, I don't probably use the tool as often as you do but I do it from time to time and I always preview so I don't happen to save anything erroneous. This problem is something that I haven't experienced before so it must be some new change to the code, or the code of another program that the SVGedit tool uses. Do you know of anyone who'd be willing to take a look at fixing this? Jonteemil (talk) 04:46, 3 August 2023 (UTC)
- @Jonteemil and Cmglee:
- You load SVGedit from Meta:User:Jonteemil/global.js, but you use Cmglee's version at User:Cmglee/SVGedit.js. That's fortunate because Cmglee is still active; Rillke has not edited in some time. You can ask Cmglee to try changing line 401 to use
image/png
to see if that fixes preview. - Glrx (talk) 05:32, 3 August 2023 (UTC)
- Thanks for your clear instructions and analysis, @Glrx: I've changed "jpeg" to "png" but the problem persists. I think rsvg previews are broken as with commons:commons_SVG_Checker. Would you be able to debug why commons:commons_SVG_Checker also gives the bug image? Thanks, cmɢʟee ⋅τaʟκ 15:34, 3 August 2023 (UTC)
- @Cmglee:
- Thanks for running the test. I'll try looking at the HTTP transfer and see if there are cross origin issues.
- The code backing the SVG Checker also uses line 451
image/jpeg
: - Thanks again.
- Glrx (talk) 17:58, 3 August 2023 (UTC)
- image/jpeg likely isn't the issue as it worked before around 2019. Don't know if Commons_talk:Commons_SVG_Checker#is_it_down? is a useful lead. Thanks too for trying, cmɢʟee ⋅τaʟκ 19:23, 3 August 2023 (UTC)
- @Cmglee and Jonteemil:
- I go to Commons SVG Checker, select an SVG file, and then execute the SVG check.
- The request to
convert.toolforge.org/svg2png.php
fails.- The request origin is https://commons.wikimedia.org
- The host origin is https://convert.toolforge.org
- The host returned the appropriate
image/png
- simple request, multipart/form-data, no preflight required
- Console reports
- Referrer Policy: Ignoring the less restricted referrer policy “origin-when-cross-origin” for the cross-site request: https://convert.toolforge.org/svg2png.php index.php:322:8
- Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://convert.toolforge.org/svg2png.php. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.
- The request fails in the browser because the
svg2png
does not supply an appropriateAccess-Control-Allow-Origin
header. - Cannot find tool on toolforge.org.
- Guess this is the source
- This URL should return the version:
- https://convert.toolforge.org/svg2png.php?version → JSON
rsvg-convert version 2.44.10
- https://convert.toolforge.org/svg2png.php?version → JSON
- svg2png.php line 35 calls
matchOrigin($origin)
and emits appropriate CORS access headers if there is a match. I'm confused. The access headers were not emitted, but if no match then no PNG should be emitted (exit is called before calling RSVG). A PNG was emitted. Is there another source? Is PHP or something else suppressing the CORS headers? - I cannot find
matchOrigin
; I expect it to be in shared/commons.php, but that links to Rillke (which is not 2 dirs up). - Interesting GitHub issue re toolforge and wmflabs (apparently fixed by renaming wmflabs URLs to toolforge URLs around 2020).
- line 8 uses old URL:
$url = $prot . "://tools.wmflabs.org/$tool_user_name/";
- but does not seem to be used for matching the origin.
- Glrx (talk) 20:36, 3 August 2023 (UTC)
- @Jonteemil and Cmglee:
- I suspect that is not the current source. I can convert SVG to PNG from a non-WMF origin, so I suspect the current source has deleted not only the origin matching test but also the CORS headers.
- Glrx (talk) 21:19, 3 August 2023 (UTC)
- @Glrx: Thanks again for investigating. I must admit that your findings are far beyond what I'm familiar with. Pinging @Redrose64: and @JoKalliauer: (may not be active recently) for their opinions, cmɢʟee ⋅τaʟκ 02:22, 4 August 2023 (UTC)
- @Cmglee and JoKalliauer:
- Turns out that Johannes cloned convert to make his SVG workaround bot. His clone has the
matchOrigin
code: - I still cannot explain the failure to supply the CORS headers.
- Glrx (talk) 04:12, 4 August 2023 (UTC)
- @Glrx: Thanks again for investigating. I must admit that your findings are far beyond what I'm familiar with. Pinging @Redrose64: and @JoKalliauer: (may not be active recently) for their opinions, cmɢʟee ⋅τaʟκ 02:22, 4 August 2023 (UTC)
- image/jpeg likely isn't the issue as it worked before around 2019. Don't know if Commons_talk:Commons_SVG_Checker#is_it_down? is a useful lead. Thanks too for trying, cmɢʟee ⋅τaʟκ 19:23, 3 August 2023 (UTC)
- Thanks for your clear instructions and analysis, @Glrx: I've changed "jpeg" to "png" but the problem persists. I think rsvg previews are broken as with commons:commons_SVG_Checker. Would you be able to debug why commons:commons_SVG_Checker also gives the bug image? Thanks, cmɢʟee ⋅τaʟκ 15:34, 3 August 2023 (UTC)
- @Glrx: Okay, I don't probably use the tool as often as you do but I do it from time to time and I always preview so I don't happen to save anything erroneous. This problem is something that I haven't experienced before so it must be some new change to the code, or the code of another program that the SVGedit tool uses. Do you know of anyone who'd be willing to take a look at fixing this? Jonteemil (talk) 04:46, 3 August 2023 (UTC)
- @Glrx and Jonteemil: I do not know why Rillke's rendering does not work, maybe consider reopening phab:T217362.
- I assume that Commons:Commons_SVG_Checker might use the same code, which recommends since 2019 to use @Jarry1250: tool: https://svgcheck.toolforge.org/ which works imho flawlessly. (But you have to manually upload the image.)
- I assume that
webservice stop webservice --backend=gridengine start
- would fix it, see wikitech:Help:Toolforge/Web. I also sometimes have to restart webservice for https://svgworkaroundbot.toolforge.org/ to work again.
- github.com/JoKalliauer/convert doesn't help in this case, it only converts svg to (less buggy) svg, it does not render svg to png, and the issue with User:Rillke/MwJSBot.js is imho independent on the SVG, therefore it won't help. I use Rillke's code basically as black-box without understanding JavaScript, so I won't be helpful in bug fixing the code, or finding the issue.
- I'm basically inactive, and stopped following treads, however I'm happy to get pinged to help. :-)
- — Johannes Kalliauer - Talk | Contributions 07:50, 4 August 2023 (UTC)
There should be a Phabricator issue (or equivalent) about this toolforge app. It is used in several places, but the behavior of the installed tool does not match the existing (and incomplete) GitHub source. Furthermore, a modification to the tool source (make the web page display the PNG rather than download it: Content-Disposition header) could avoid a lot of uploads at File:Test.svg. Glrx (talk) 23:40, 18 August 2023 (UTC)
- Submitted Phab:T345972 Glrx (talk) 04:27, 9 September 2023 (UTC)
Similar issue at Commons_talk:Commons_SVG_Checker#Previews_aren't_generated. Glrx (talk) 16:57, 8 October 2023 (UTC)