Commons:Village pump/Technical/Archive/2021/03

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

19:05, 1 March 2021 (UTC)

Wrong century in structured data

When I added structured data for an icon, I filled in the century when it was made. Although I typed 17, I was told that it would be displayed as 1. century, and so it was; I had to manually correct it. Did I do something wrong? --Jonund (talk) 15:42, 2 March 2021 (UTC)--Jonund (talk) 16:25, 1 March 2021 (UTC)

@Jonund: The year 17 AD is in the first century indeed. The popup sets the precision, not the unit, so to achieve the 17th century, either type 17. century, or type a year in the 17th century (e.g. 1700) and set the precision to century. —Tacsipacsi (talk) 13:19, 3 March 2021 (UTC)
Thank you! --Jonund (talk) 16:47, 3 March 2021 (UTC)

17:50, 8 March 2021 (UTC)

GIF not animating

Hi, does anyone know why the chess gif does not animate, while the other gif seems to work fine?
Acagastya (talk) 07:31, 9 March 2021 (UTC)

.

For reference, this is what happens on my screen.
Acagastya (talk) 08:42, 9 March 2021 (UTC)
@Acagastya: it is too big for our thumbnail generator: 188 megapixels (720 x 840 x 312 frames) exceeds the limit of 100 megapixels. See Commons:File types#Animated GIF. The image itself is fine, but the thumbnails will not work properly. MKFI (talk) 09:38, 9 March 2021 (UTC)
All right. Thanks, @MKFI: .
Acagastya (talk) 10:49, 9 March 2021 (UTC)

some sort of issue with deleting a file with a talk page

i was trying to delete one of my files that was broken for some reason and it did have a talk page, so for some reason it wouldn't let me nominate it for deletion. can someone please explain how i can't delete a file with a discussion page? Patrick799 =) (talk) 16:31, 10 March 2021 (UTC)

Why do these tagged edits not show up in recent changes?

https://commons.wikimedia.org/w/index.php?title=Special:RecentChanges&tagfilter=fileimporter-imported --RZuo (talk) 21:32, 10 March 2021 (UTC)

Making a license template machine-readable

Due to a change in law effective March 1, 2021, the official Swiss geodata (maps etc.) by swisstopo can now be used freely for any purpose, also commercially, but with an attribution requirement. There is now {{Attribution-Switzerland-mapdata}} for that but, apparently, this license template is not yet machine-readable, resulting in the files using it being placed in Category:Files with no machine-readable license. Maybe someone skilled in template editing could fix this? Gestumblindi (talk) 16:59, 7 March 2021 (UTC)

 Info Template moved to {{Attribution-Swisstopo}} - still needs to be made machine-readable. Gestumblindi (talk) 19:54, 11 March 2021 (UTC)
Working AntiCompositeNumber (talk) 00:25, 12 March 2021 (UTC)
@Gestumblindi: ✓ Done AntiCompositeNumber (talk) 00:47, 12 March 2021 (UTC)
@AntiCompositeNumber: Thank you, great! :-) Gestumblindi (talk) 00:56, 12 March 2021 (UTC)

this is just a issue report on something i saw with the pictures of the day, even though they can only be edited by administrators since the page is protected it does not have the "view source" tab on top of it. Patrick799 =) (talk) 14:04, 11 March 2021 (UTC)

@Patrick799: I assume you mean the picture of the day like for example today's File:Kifli made with spelt flour (Serbian cuisine).jpg? That seems to be by design, see phab:T13700 for more information. Multichill (talk) 16:47, 11 March 2021 (UTC)

@Multichill, yes exactly. Patrick799 =) (talk) 17:00, 11 March 2021 (UTC)

Url2Commons: simulation OK, upload failed

I've tried to upload some files via url2commons, the simulation was OK, but the upload failed. I'm assuming that something can be wrong with the $DESCRIPTOR$ string, but I can't find out, what is causing the problems – there is no further error explanation.

I put this into the URL field:

http://bubenic.cz/fotky/2013/02_okolo_prilep/imgp7446.jpg Přílepy, imgp7446 (2013-02).jpg |Zajíc vyskočil z jamky a utíká, Okolo Přílep, 2013

And I tried to put this into the Description field:

=={{int:filedesc}}==
{{Information
| Description    = {{cs|$DESCRIPTOR$}}
| Date           = 
| Source         = $URL$
| Author         = {{Creator|Wikidata=Q105840092}}
| Permission     = [http://bubenic.cz/fotky/ see webpage]
| Other_versions = 
}}

=={{int:license-header}}==
{{cc-by-sa-4.0}}

[[Category:Photographs by Jiří Bubeníček]]

I firstly tried to enter the whole (cs+en) description (http://bubenic.cz/fotky/2013/02_okolo_prilep/imgp7445.jpg Přílepy, imgp7445 (2013-02).jpg |{{cs|1=Je tu ve sněhu mnoho jamek skoro v každé zajíc, Okolo Přílep, 2013}}{{en|1=Přílepy, 2013}}) and letting just $DESCRIPTOR$ in the Description line. Then I have realised, that the pipes inside the templates might have caused the problems, but removing them didn't solved the problem. I was able only to upload the file with the "hard-typed" description (no $DESCRIPTOR$ and | Description = {{cs|1=Je tu ve sněhu mnoho jamek skoro v každé zajíc, Okolo Přílep, 2013}}{{en|1=Přílepy, 2013}}. Any suggestions? — Draceane talkcontrib. 19:02, 10 March 2021 (UTC)

i had problems for https://thumbs.worthpoint.com/zoom/images1/1/0913/02/1932-kings-theater-hong-kong-loge_1_f9b47698d817f298cfa1090ae53b1d04.jpg and https://eservice.nlb.gov.sg/cms/image/98dfb824-eb7f-4cbb-9d90-b420709d04a1.jpg . $DESCRIPTOR$ or $URL$ might not be the problem because i always replaced them with something else.--RZuo (talk) 21:32, 10 March 2021 (UTC)
Quite curious, replacing $DESCRIPTOR$ worked for me. @Magnus Manske: Could you look into this, please? — Draceane talkcontrib. 17:11, 11 March 2021 (UTC)
@RZuo: I'm just thinking about transferring these files anyway and then asking for adding the descriptions by a bot. — Draceane talkcontrib. 17:59, 13 March 2021 (UTC)

Query

Hello, everyone. Around 4 years ago, I uploaded a file (File:Saina Nehwal in 2011.jpg) & cropped it from sides a bit to make it suitable for the large number of infoboxes where it was in use. Ideally, I should have uploaded the trimmed version as a new file, but I didn't do that as the crop didn't seem that significant. Anyway, a few months earlier, a good-faith editor (Minerva97) uploaded two poorly cropped versions of that file and reverted the original file to its older version, which in turn made it unsuitable for a large number of mainspace articles – see here. So, I have two questions:

a) Can't we just keep the original file as it was for the last 4 years (i.e. as the version of 19:59, 6 December 2016)? I mean is there any technical issue with that?

b) Minerva97's two cropped files seem improperly cropped. I mean the first file seems excessively cropped: File:Saina Nehwal in 2011 (cropped-02).jpg. And the second one seems unbalanced from sides: File:Saina Nehwal in 2011 (cropped-01).jpg. So is it fine to keep them on the project?

Thanks. - NitinMlk (talk) 21:24, 14 March 2021 (UTC)

23:20, 15 March 2021 (UTC)

template knowledge / lua help requested

rationale

Hi, in Austria for various lists of cultural heritage monuments, natural monuments, various other catalogues like Tiroler Kunstkataster etc. we highly depend on various templates taking the id of an object to tie images and categories related to such an object together. See e.g.

which render e.g. for {{Denkmalgeschütztes Objekt Österreich}}:

  This media shows the protected monument with the number 4711 in Austria. (Commons, de, Wikidata)

Now our data provider for the cultural heritage has switched to a completely new set of Ids. This touches about 38000 different objects with about 190000 transclusions. Old ids will be discontinued. We have got a mapping table to do a proper transition.

Instead of switching one proprietary id to another proprietary id, my intent is to switch to Wikidata-Ids and maintain the mapping tables in Wikidata (already imported). Thus I want to

  • switch all usages of above templates to a single wrapper template taking the wikidata item id as its single argument and propagate to the existing templates (for the moment). You can find a sketch at User:Herzi Pinki/WDAC
  • fold multiple different Ids and templates to a single template instance for each object. An object can have more than one such id for different sets of data, an image can show more than one object and thus have more than one id of the same kind.
{{User:Herzi Pinki/WDAC|id=Q37945080}}
----
{{User:Herzi Pinki/WDAC|id=Q38030908}}

will render User:Herzi Pinki/WDAC


User:Herzi Pinki/WDAC

{{#if:
{{data|item=Q255834|property=P300}}
|{{data|item=Q255834|property=P300}}
|{{data|item={{data|item=Q255834|property=P131|displayformat=raw|numval=1}}|property=P300}}
}}
recursively inserting the code 4 times will be sufficient to find the ISO 3166-2 code from a bottom administrative unit. Doing it that way gives unmaintainable template code.
  • when infrastructure is ready, I will set up a bot to do the real transition.

question 1

Thanks for the ping. I would first add the new id's to the existing Wikidata items. Don't remove the old id's from Wikidata (and please don't do that in the future).
Use Wikidata, not by including the Qid in the wikitext, but by including it in the structured data on Commons probably by adding depicts (P180) and this new property. Than the template can be updated to start pulling data from SDC and Wikidata. See {{Geograph from structured data}} for inspiration (ht User:Jarekt). Multichill (talk) 16:56, 11 March 2021 (UTC)
@Herzi Pinki: Just an example. Multichill (talk) 17:15, 11 March 2021 (UTC)
@Multichill: Thanks for your comment. I never had the intention to NOT keep both ids in parallel forever. But I'm not the only one here. New ids are already imported to Wikidata.
I also pinged you to draw your attention on what consequences this transition will have on your monument database (what is necessary to smoothen it).
this new property will not help as values must be unique (at least that's what I understand from the request). Monument images can show more than a single protected object (e.g. the church and the rectory; a chapel and natural monuments aside, etc., thus it must be possible to have multiple occurrences of the same template with different object focus)
your example: How to iterate over multiple depicts (P180)?
need this also for categories, there is no depicts (P180) nor even SDC for categories.
waiting for additional input and re-thinking. --Herzi Pinki (talk) 18:36, 11 March 2021 (UTC)
@Herzi Pinki: I was afraid you would say that because I was thinking about that too.
I just want to put {{Cultural heritage monument}} on a file. That should show one or more relevant templates.
The {{Cultural heritage monument}} should probably have a lookup table with lines like: For Rijksmonument ID (P359) use {{Rijksmonument}}
The template loops over the depicts (P180) items. On each item looks if it contains one or more P id's defined in the lookup table and output it using the relevant template.
So for example on File:P2ev.jpg I would be able to replace the list of templates now with just one {{Cultural heritage monument}}. @Jarekt: do you think you can help with this? Multichill (talk) 17:57, 15 March 2021 (UTC)
We could start on Module:Cultural heritage monument, but I am afraid that scanning all depicts for bunch of properties might get expensive very quickly. Maybe go through instance of (P31) statements of first 50 depicts and if on a white list than check for other properties? I had to add a limit on number of depicts to process in some cases as some people go crazy with those. I can write such code, if we have list of mappings of which property maps to which template (we can start with a few and than expand). --Jarekt (talk) 18:12, 15 March 2021 (UTC)
Will not work for categories. As there are no SDC and thus no depicts (P180) on categories. Our templates in AT provide more than just a single id to an external data provider, they have also navigational purposes and provide a suitable upload link on categories. I'm using that a lot to get images and categories in consistent state. --Herzi Pinki (talk) 18:52, 15 March 2021 (UTC)
@Jarekt: you probably only need to work on depicts (P180) that have heritage designation (P1435). That would trim it down quite a bit.
@Herzi Pinki: It will work on categories because categories have sitelinks, that's also how {{Wikidata Infobox}} works. Multichill (talk) 20:29, 15 March 2021 (UTC)
categories might have sitelinks, categories might have corresponding wikidata items. But this by far is not true for all commons categories. I want to provide a mechanism, I do not want to provide also the data necessary for the mechanism to run smoothly. --Herzi Pinki (talk) 20:47, 15 March 2021 (UTC)

question 2

  • is there any template / lua module, that yields the ISO 3166-2 code starting from an wikidata-item embedded in located in the administrative territorial entity (P131)? (wdt:P300/wdt:P131* in sparql). Would be useful also in other contexts as a separate function / template / module. I need help here.
Herzi Pinki, The easiest way to write it might be in Lua. I put some code for "(wdt:P300/wdt:P131* in sparql)" part in Module:PropertyChain/sandbox so that {{#invoke:PropertyChain/sandbox|PropertyChain2|qid=Q255834|pid=P131|endpid1=P300}} will give "AT-6". --Jarekt (talk) 02:40, 12 March 2021 (UTC)
Thanks @Jarekt: , good starting point. I have to elaborate it a bit. --Herzi Pinki (talk) 18:38, 12 March 2021 (UTC)

@Jarekt: Need again help on Module:PropertyChain/sandbox and the new {{#invoke:PropertyChain/sandbox|ISO3166Code|qid=Q386729|sep='/'}} Did not get the clue to debugging Luacode. Can you help me and provide the basic infos for debugging lua, or read the code and find the error? best --Herzi Pinki (talk) 18:36, 15 March 2021 (UTC)

@Herzi Pinki: , I did not figured out any useful debugging techniques in Lua. Sometimes you can write to return value, which can be displayed, or working on very small chunks of code . We have some good unit testing codes, see Module:TagQS/testcases, but no easy debugging. I did not look at ISO3166Code yet but I found recursive functions particularly hard to debug, so doing the same with a loop might be easier to get to work. --Jarekt (talk) 00:40, 19 March 2021 (UTC)
@Jarekt and Herzi Pinki: mw:Extension:Scribunto/Debug console might be helpful. For instance, open [13] and type =p.tincture("argent") in the "Debug console" – Simon04 (talk) 17:31, 19 March 2021 (UTC)
thanks for proper help. I've learned something
  • don't name a local variable in a module p also p
now it runs: User:Herzi Pinki/sandbox --Herzi Pinki (talk) 15:54, 21 March 2021 (UTC)

16:50, 22 March 2021 (UTC)

Stash has not uploaded for days

Does anyone here have access to the server to publish File:Press Briefing by Press Secretary Jen Psaki, 2021-03-10.webm? I uploaded the file days ago but it still hasn't published. Cf. Commons:Administrators'_noticeboard#Stash_has_not_uploaded_for_days. Thanks. —Justin (koavf)TCM 09:33, 21 March 2021 (UTC)

I am also having this issue or something like it while uploading DJVUs with Pywikibot. I have one of 115MB and one of 230MB and neither can be uploaded without a pywikibot.data.api.APIError: uploadstash-file-not-found: Key "{BLAH}.djvu" not found in stash. During a chunked upload (in 1MB chunks) I also got a couple of 503 and finally a 504 error. Trying an unchunked upload got me a 413 Payload size error. Inductiveload (talk) 13:02, 22 March 2021 (UTC)
Why has this issue been ignored by all admins for weeks? —Justin (koavf)TCM 03:45, 26 March 2021 (UTC)
@Inductiveload: After uploading literally a dozen times with the chunked uploader and publishing from my stash repeatedly, it just worked with the UploadWizard. ¯\_(ツ)_/¯ —Justin (koavf)TCM 05:42, 26 March 2021 (UTC)
I finally got one of my files uploaded with the Wizard too (at an average speed of 50kBps, so it still took a fair while!) Inductiveload (talk) 09:58, 26 March 2021 (UTC)

17:28, 29 March 2021 (UTC)

Please could someone make Template:VEFriendly available on Commons?

Hi all

Currently the Commons: namespace has Visual Editor disabled, I really want to use VE on some documentation for Structured Data on Commons I'm creating to make it easier to contribute to.

There's an extremely helpful template on English Wikipedia called Template:VEFriendly which allows you to easily edit a page in VE but it isn't available on Commons yet. Please could someone who knows how to make templates make it available on Commons for me? I tried making it in my userspace first but it just won't work and I don't want to guess at things and break something by accident.

Many thanks

John Cummings (talk) 12:26, 31 March 2021 (UTC)

I have created {{VEFriendly}} for you. I have not tested it. Jonesey95 (talk) 15:17, 31 March 2021 (UTC)
Thanks so much Jonesey95, works perfectly :) John Cummings (talk) 15:57, 31 March 2021 (UTC)

Files no longer appear at the top, but below the infobox

For any category I open, files no longer appear at the top, but below the infobox (like someone suddenly inserted {{clear}} inside {{Wikidata Infobox}}). Does anyone else have this issue? --Orijentolog (talk) 19:54, 31 March 2021 (UTC)

User:Jon (WMF) has added a workaround to MediaWiki:Common.css. AntiCompositeNumber (talk) 20:52, 31 March 2021 (UTC)

@Rodhullandemu: for me it looks fine now. :) --Orijentolog (talk) 08:28, 1 April 2021 (UTC)

Suggestion for the WMF about users editing without a Wikimedia SUL account

I have no idea whom to contact or where to post this to leave a suggestion related to the fact that the Wikimedia Foundation (WMF) will soon mask IP addresses of users that are not signed in from everyone without the Checkuser rights (something which I consider a victory for privacy), so if anyone knows a WMF engineer that concerns this or is somehow involved in this then please ping them.

I would like to make a suggestion, namely while masking IP addresses make country-codes still visible, these are three letter codes like "NLD" for the Netherlands or "VNM" for Vietnam. I don't think that it will violate one's privacy as much, and I think that we can understand when an Iranian user chooses to edit Homosexuality-related articles without an account linked to their name for example, while still making it easy to spot when suddenly a large number of users from the same country (or perhaps even different countries) start editing the same area (as that is usually how dynamic socks operate). --Donald Trung 『徵國單』 (No Fake News 💬) (WikiProject Numismatics 💴) (Articles 📚) 07:09, 22 March 2021 (UTC)

See m:IP Editing: Privacy Enhancement and Abuse Mitigation#Q: How do I get involved?. For those who cannot or doesn't prefer using the meta talk page, they have a web form. (I don't know if they still actively monitor the web form, though.) whym (talk) 13:24, 22 March 2021 (UTC)
@Whym: , well, I'm permanently blocked from Meta with no chance of ever getting unblocked. It would be really handy if the Wikimedia Foundation (WMF) would create a separate wiki or these discussions or ask feedback locally like they did for the Universal Code of (UCoC). I prefer not to use private web forms as I believe in transparency and believe that too much that affects these websites is already discussed off-wiki. --Donald Trung 『徵國單』 (No Fake News 💬) (WikiProject Numismatics 💴) (Articles 📚) 10:58, 6 April 2021 (UTC)

Is FormWizard installed on Commons?

Hi all

How do I find out if FormWizard is installed on Commons? If it isn't what is the process of requesting it is installed? I'd really love to use it for some documentation I'm working on, its proved really useful when I've used it on Wikidata and English Wikipedia previously.

Thanks

John Cummings (talk) 14:27, 19 March 2021 (UTC)

All installed extensions are listed on Special:Version, and since it is not there, it is not installed. The process of getting it installed is get conseus here and if you get permission then ask on phabricator to get it installed.--Snaevar (talk) 11:14, 7 April 2021 (UTC)

Edit window - geogroup button

I would really appreciate it if someone with the right knowledge would add a {{Geogroup|level=1}} button next to the {{Wikidata Infobox}} button in the tool bar under the category edit windows in i.e. Category:Bornholmsgade. Thanks in advance. --Hjart (talk) 12:51, 24 March 2021 (UTC)

@Hjart: It can be added at MediaWiki:Edittools (can be edited only by admins). —Tacsipacsi (talk) 00:43, 28 March 2021 (UTC)
@Hjart: you can add this to User:Hjart/common.js. it will give you a button on the first row of edit window.
var customizeToolbar = function () {
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
	'section': 'main',
	'groups': {
		'mine': {
			'label': 'mine'
		}
	}
} );
	
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
	section: 'main',
	group: 'mine',
	tools: {
		"Geogroup": {
			label: 'Geogroup',
			type: 'button',
			icon: '//upload.wikimedia.org/wikipedia/commons/7/74/Earth_icon2.png',
			action: {
				type: 'encapsulate',
				options: {
					pre: "{{Geogroup|level=1}}",
					ownline: true
				}
			}
		}
	}
} );
};

/* Check if view is in edit mode and that the required modules are available. Then, customize the toolbar … */
if ( [ 'edit', 'submit' ].indexOf( mw.config.get( 'wgAction' ) ) !== -1 ) {
	mw.loader.using( 'user.options' ).then( function () {
		// This can be the string "0" if the user disabled the preference ([[phab:T54542#555387]])
		if ( mw.user.options.get( 'usebetatoolbar' ) == 1 ) {
			$.when(
				mw.loader.using( 'ext.wikiEditor' ), $.ready
			).then( customizeToolbar );
		}
	} );
}
see mw:Extension:WikiEditor/Toolbar customization.--RZuo (talk) 10:43, 9 April 2021 (UTC)
@RZuo: Thank you very much! --Hjart (talk) 11:00, 9 April 2021 (UTC)

Handling HDR videos for Commons

Hey dear Wikimedians,

I will change soon to a full-frame camera to create videos in UHD HDR (HDR10+, I guess). My question is, how can I transfer HDR videos to Commons without reducing quality (In native HDR)?

Thanks for your help, --PantheraLeo1359531 😺 (talk) 16:38, 22 March 2021 (UTC)

@PantheraLeo1359531: , have you tried using Video2commons? --Donald Trung 『徵國單』 (No Fake News 💬) (WikiProject Numismatics 💴) (Articles 📚) 11:12, 6 April 2021 (UTC)
Hey, video2commons can handle HDR videos? That would be fine! Thanks for your help! :) --PantheraLeo1359531 😺 (talk) 18:37, 6 April 2021 (UTC)
@PantheraLeo1359531: , I mean if you first upload them somewhere else. I've seen that many users were given the advice to first upload elsewhere and then use this tool to import videos. Does the Upload Wizard eVen accept videos? What format (file type) are your HDR videos? --Donald Trung 『徵國單』 (No Fake News 💬) (WikiProject Numismatics 💴) (Articles 📚) 18:59, 6 April 2021 (UTC)

I assume that "File:Mengergitter 20210330.webm" is one of these videos? --Donald Trung 『徵國單』 (No Fake News 💬) (WikiProject Numismatics 💴) (Articles 📚) 19:02, 6 April 2021 (UTC)

Yes, that was uploaded via Video2Commons, but only as SDR video. --PantheraLeo1359531 😺 (talk) 19:49, 6 April 2021 (UTC)