Commons:Village pump/Technical

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

Shortcuts: COM:VP/T • COM:VPT

Welcome to the Village pump technical section
Technical discussion
Village pump/Technical Octicons-location.svg
 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; the latest archive is Commons:Village pump/Technical/Archive/2023/04.

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

Non-manual way to upload these photos?[edit]

Hello, I am trying to upload some photos from a National Park Service account on Flickr. I love the flickr URL uploader, but can't seem to use it for these photos. It auto-tags them as ineligible due to Flickr's autolicensing every image as "all rights reserved". Despite this, the images by the Federal Government are in the public domain, and are definitely PD as stated extremely clearly in the Flickr account's "About" page. Is there a way for me or a user with more power to upload them without having to download each one and slowly reupload and relabel? ɱ (talk) 22:25, 29 March 2023 (UTC)Reply[reply]

Does anyone have any insight on this? ɱ (talk) 03:26, 29 April 2023 (UTC)Reply[reply]

What is SDC and why does it think I'm on the other side of the world?[edit]

On File:Osprey on post, Bronx, NY.jpg, I have a message saying, "There is a discrepancy of 10358218 meters between the above coordinates and the ones stored at SDC (40°51′15″N 73°47′14″E, precision: 5 m). Please reconcile them.". What is SDC and why does it think my longitude should be E? RoySmith (talk) 19:24, 20 April 2023 (UTC)Reply[reply]

@RoySmith SDC is Structured Data on Commons. It thought your location should be E because in the initial revision ([1]), 73.787143 was not negative. Tdorante10 fixed it in wikitext (thanks!), and I just fixed it in the structured data for you. —‍Mdaniels5757 (talk • contribs) 00:03, 21 April 2023 (UTC)Reply[reply]
Thanks! RoySmith (talk) 01:41, 21 April 2023 (UTC)Reply[reply]
I think STC is intended to do something good, some day. Currently what I see it doing is, it stores the first coordinates that the bot sees for the picture. When the coords are corrected in the picture page, it puts out a message saying it's different, rather than simply correct STC itself. Perhaps some day someone will make a better system for handling geocoordinates. Jim.henderson (talk) 12:38, 22 April 2023 (UTC)Reply[reply]
I've recently started using iNaturalist. They have a great system. It puts up a little map, you zoom/pan around until you find the right location, and click. Easy peasy. Unclear why commons doesn't have something like that.
Of course, even easier would be if my fancy-schmancy camera could just include a $5 GPS chip and geotag all the images automatically. But I digress. RoySmith (talk) 13:51, 23 April 2023 (UTC)Reply[reply]
@RoySmith: I was snapping pix yesterday in Bushwick with my old Nikon Coolpix P190 that has GPS built in. Unlike my camera phone it's only real GPS, so it isn't as quick or accurate as my camera phone, so I do a lot of pix with both. I do small adjustments mostly by transcribing the correct lat-lon from Google Earth. A few cameras are still made with this feature. Hardly any; it's regarded as a toy for casual tourists. Drat. Some cameras provide a Wi-Fi connection to your phone and use that to geotag the pictures. My experience is, it doesn't work as reliably as when the GPS is in the camera. Drat; it's part of the general idea that the camera isn't supposed to be a computer, so it only has a poor customized computer in it instead of one in which you can mix and match software.
When Wikimania was in Montreal, I sat down for lunch and started complaining, same as you did, that Commons has no easy locating tool that clicks on a map. The fellow next to me said to look at the side menu of any picture and click "Locate-tool". He talked me through the process, which was indeed easy. This is how I generally do it when the P-190 didn't get a fix. Wikidata also has a little map-picker but not as nice as the Commons Locate-tool. Maybe we need a session of the quarterly Commons Photographers Group zoomcalls, to study such matters. And of course I'll be delighted to meet you in The Bronx or elsewhere for discussion and demo. Especially if we can persuade two or three others to join us. — Preceding unsigned comment added by Jim.henderson (talk • contribs) 15:16, 23 April 2023‎ (UTC)Reply[reply]

When rendering SVG images containing Chinese characters as PNG thumbnails, there may be garbled code issues[edit]

File:Min Kingdom, 945 v2 (zh-hans).svg is an example. When you open the origin SVG photo in the browser, the Chinese characters display normally. But in some PNG previews, the characters display abnormally. They are displayed as blocks. The other PNG previews are normal. So I think there must be some bugs in Wikimedia Commons. Shenzhiming88 (talk) 15:01, 22 April 2023 (UTC)Reply[reply]

This is not an isolated case, my hand-written SVG image with Japanese text also suffers the similar issue, but it happens to PNG renders of certain dimension such 1624px. In both cases, purging the image description page or the glitchy PNG render does not fix it. -- Sameboat - 同舟 (talk · contri.) 09:40, 23 April 2023 (UTC)Reply[reply]

First, purge the image page, it will tell the thumbnailer to re-do the png thumbnails. Wait several minutes, it is not going to appear right away. If that does not work, then take a look at meta:SVG_fonts#Chinese_fonts_comparison, and the chapter above that for Japaneese, it lists the fonts that the server has installed. The font specified in the Chinese file is not installed and the Japaneese one is using generic fonts - more specific font may be better. Specifying one from the "SVG fonts" page, especially for the Chineese one, will cause the thumnailer not to figure out on its own what font to use.--Snævar (talk) 12:32, 23 April 2023 (UTC)Reply[reply]
I don't think it works in my case. I specified "VL Gothic,WenQuanYi Zen Hei" for the Japanese text and "Arimo,Liberation Sans,Helvetica,Arial,sans-serif" for the rest of Latin characters. The glitch just happens so randomly, when I made minor changes to the SVG, the Wikimedia PNG looks okay, but the next time it is completely tofu glyph. We really need the programmers to look into this in order to convince other SVG contributors to not convert text into vector path. Sameboat - 同舟 (talk · contri.) 00:50, 24 April 2023 (UTC)Reply[reply]
OK, the programmers are at phabricator. File a bug with the tags "thumbor" and "SRE-swift-storage", your wikimedia commons account will work there. Snævar (talk) 09:47, 24 April 2023 (UTC)Reply[reply]
Submitted Phabricator:T335271. Sameboat - 同舟 (talk · contri.) 10:30, 24 April 2023 (UTC)Reply[reply]

Does anyone know why Template:Place by century stops at 48th century BC? Category:Africa in the 52nd century BC and Category:Africa in the 60th century BC do not show up. Ricky81682 (talk) 02:02, 24 April 2023 (UTC)Reply[reply]

I don't know, but now that I've seen that code I feel like I should at least attempt to implement {{Place by century}} and {{Subject by century}} in Lua, and I may discover an answer to your question in the process. —CalendulaAsteraceae (talkcontribs) 02:21, 24 April 2023 (UTC)Reply[reply]
@Ricky81682: It's because {{Subject by century}} only checks back to the 50th century BC. I'm working on fixing this. —CalendulaAsteraceae (talkcontribs) 04:23, 24 April 2023 (UTC)Reply[reply]

Tech News: 2023-17[edit]

MediaWiki message delivery 22:01, 24 April 2023 (UTC)Reply[reply]

Need for an additional PD-UK template[edit]

As you can see, As you can see, this copy of an engraving does have an author. The template {{PD-UK}} is no longer valid. The licensing information linked to via {{PD-UK-unknown}} indicates that this non-photo (published prior to 1 August 1989, and where the publication was not 20 years after the author's death has a copyright expiring 70 years after the author's death) is in the public domain, but there is no appropriate PD UK template available for use. I was hoping someone might make such a template. MargaretRDonald (talk) 04:21, 25 April 2023 (UTC) @MichaelMaggs: Reply[reply]

@MargaretRDonald: I'm not clear on whether you want {{PD-old-100-expired}} ({{PD-old-auto-expired}} if you have a death year for S. Stoutshanks) or {{PD-UK-posthumous-non-photo-1996}}, but given the publication c. 1829 one of those should be appropriate. —CalendulaAsteraceae (talkcontribs) 03:46, 26 April 2023 (UTC)Reply[reply]
@CalendulaAsteraceae: Note that publicstion is not postumous. Therefore {{PD-UK-posthumous-non-photo-1996}} is no good. Nor is {{PD-old-expired}} works but is not ideal. I would like to refer to UK copyright law and not all cases will have such clear-cut death dates. Ideally, I would like {{PD-UK-non-photo-1996}} MargaretRDonald (talk) 04:01, 26 April 2023 (UTC)Reply[reply]

Eseentially for the many cases I expect to encounter, I do need what I asked for rather than these very general PD templates. MargaretRDonald (talk) 04:12, 26 April 2023 (UTC)Reply[reply]

Help with Module:Century?[edit]

I'm trying to implement {{Century}} as a Lua module, but {{Century/sandbox}} makes it clear that something's not working. Help? —CalendulaAsteraceae (talkcontribs) 03:10, 26 April 2023 (UTC)Reply[reply]

Ah. New question, does anyone have advice on how to make my code more efficient? —CalendulaAsteraceae (talkcontribs) 05:39, 26 April 2023 (UTC)Reply[reply]
Actually, never mind that; using Module:Formatnum directly instead of going through the template worked wonders. I would still appreciate a code review if anyone's interested. —CalendulaAsteraceae (talkcontribs) 05:46, 26 April 2023 (UTC)Reply[reply]
Is there a better way to get a user's language than mw.getCurrentFrame():preprocess("{{Int:Lang}}")? —CalendulaAsteraceae (talkcontribs) 06:52, 26 April 2023 (UTC)Reply[reply]
No, there is not an pure-lua way of doing int:lang. See the first comments in phab:T68051 for why, those are from developers, the rest of the bug are comments from users.--Snævar (talk) 11:31, 26 April 2023 (UTC)Reply[reply]
@Snævar: Thank you! —CalendulaAsteraceae (talkcontribs) 23:08, 30 April 2023 (UTC)Reply[reply]

Call to discuss key workflows as part of WMF annual planning[edit]

Hello,

As you may know, the various teams at the WMF are currently in the midst of annual planning. Within the Product and Technology department specifically, there are a series of proposed Objectives and Key Results, one of which specifically talks about “moderator workflows” [WE1.3]. Representatives of teams who are working on that topic would like to hear directly from people who take responsibility for certain workflows on Commons which could be classified as “moderation”: including but not limited to processing deletions, mass categorisation, bot approvals… This is to understand better your perspectives on necessary improvements for those kinds of moderation workflow.

This call will take place on: 3rd May @15:30 UTC. For more information and to confirm participation, please visit the sign-up page

Your input during the call would be highly appreciated. But this is not the only way you can provide feedback. There are other ways to discuss and comment upon the WMF annual plan, described here, as well as on the relevant section of the OKRs document talkpage linked above.

Best regards, Udehb-WMF (talk) 09:10, 26 April 2023 (UTC)Reply[reply]

HotCat[edit]

Hello, I wrote at HotCat's talk page last month, and it's still been a huge irritant: why does HotCat always edit conflict? Every time after I manually edit a page and then want to categorize via HotCat, an edit conflict incorrectly pops up and I have to re-do the categorization. How can it be fixed, can anyone look into it? Thank you, ɱ (talk) 01:51, 27 April 2023 (UTC)Reply[reply]

Image Annotator[edit]

Interesting discovery at Help_talk:Image-Annotator#Out_of_service_(image_annotator). Enhancing999 (talk) 11:26, 27 April 2023 (UTC)Reply[reply]

File:Chicago-chinatown2 new.jpg[edit]

I tried to upload an improved version of File:Chicago-chinatown2 new.jpg but it errors when I do that, says the file is a png, but is listed a jpg so it refuses to let a new version be uploaded. I thought I could fix that error by having the file renamed to a png, but that was denied. What's going on with this file? Is this a bug? I'm just confused. Thanks! Nesnad (talk) 14:38, 27 April 2023 (UTC)Reply[reply]

Files with .jpg extension should be JPEG files, and files with .png extension should be PNG files. If you have a PNG file, you can’t overwrite a JPEG file with it, because that would mean either that the old JPEG file had a .png extension (which is impossible) or that the new PNG file had a .jpg extension (which is also impossible). You can either save the improved version in JPEG and overwrite the existing image with that, or upload the PNG with a new name. —Tacsipacsi (talk) 00:54, 2 May 2023 (UTC)Reply[reply]

Test whether some strings are identical[edit]

i've been trying to add a maintenance cat to Template:Media of the day/layout to detect cases whereby pages transcluding Template:Media of the day do not match the actual file used by that motd. on a file page, the template is always used as {{Media of the day|yyyy|m|d}} . my design logic is as such:

if pagename = filename used in motd/yyyy-mm-dd then nothing

else if pagename = target of filename used in motd/yyyy-mm-dd then nothing

else insert cat.

i've run into a few problems:

  1. our module:redirect doesnt work like enwp original. it doesnt return pagename properly in some cases.
  2. problem with underscores. sometimes the filename used in motd/yyyy-mm-dd uses underscores instead of whitespaces. i dont have time to check how to solve this for now.

i'm giving up this for now because of real life urgencies. maybe someone could take it over from me. RZuo (talk) 10:07, 28 April 2023 (UTC)Reply[reply]

SVG rendering varies based on resolution[edit]

It's solved for the discussed images (thanks to User:Glrx), but a bug mentioned at Commons:Graphic_Lab/Illustration_workshop#SVG_mystery_-_element_missing_in_some_PNG_versions (Phab:T276684, if it's the one) seems to lead png versions of SVG to vary depending on the chosen image size.

Even if the bug mentioned there isn't fixed, it would be preferable if it was made to fail consistently. Enhancing999 (talk) 11:01, 29 April 2023 (UTC)Reply[reply]

I have a couple problems here. First is the one reported by @Ricky81682 above: the code only checks back to 5000 BC, but some categories go back further than that. Also, adding more centuries means adding more expensive function calls. Is there a way to get a list of all extant subcategories of a category? This could be filtered and used to determine the starting point when showall = true, and used in place of mw.site.stats.pagesInCategory when showall = false.

Second, at the moment the category links aren't being interpreted as links; see {{Subject by century/sandbox}}. How can I fix this? —CalendulaAsteraceae (talkcontribs) 01:05, 1 May 2023 (UTC)Reply[reply]

@CalendulaAsteraceae Or we create a smaller template uniquely for this case? Ricky81682 (talk) 01:33, 1 May 2023 (UTC)Reply[reply]
@Ricky81682: I added an optional minimum century parameter to the module, which fixes this problem. (I would still like a better algorithm if feasible.) —CalendulaAsteraceae (talkcontribs) 01:50, 1 May 2023 (UTC)Reply[reply]

Tech News: 2023-18[edit]

MediaWiki message delivery 01:43, 2 May 2023 (UTC)Reply[reply]

Copying SVG images as JPGs, and poor handling of transparency.[edit]

Common problem, but here's just one typical example: File:Oxygenation-atm-2.svg

This is a line chart (any diagram has the same issue) drawn as an SVG. PNG thumbnail versions are linked conveniently, in different sizes. Hand-editing the link extension even gives JPGs.

The problem is that this SVG is transparent (whether it ought to be entirely so is another question). The PNGs are transparent too. But the "default rendering colour" for that transparent is black, rather than white. This is the opposite of behaviour for the main use case on Wikipedia, where they're placed onto a white background.

The result of this is that there's no simple way to copy and paste such an image into most of the widespread social media platforms. It'll be rendered as a black rectangle instead.

Even when thumbnailed as a JPG (i.e. with no transparency) the outcome is the useless black rectangle (and surely as a JPG there's no reason for that behaviour at all).

The MediaWiki behaviour when rendering transparent bitmaps such as this should be to give a useful output. That would involve changing the implied background colour (even when transparent) to be white, not black, thus downstream renderers that don't implement transparency would at least give a visible image. Especially so for a JPG render here, as transparency has to be flattened at that point anyway.

This would make the thumbnailing behaviour more consistent with the publishing approach on Wikipedia, it would also make the thumbnails for generally useful for readers who are re-using these images off-Wikimedia. Andy Dingley (talk) 10:15, 3 May 2023 (UTC)Reply[reply]

So in other words, you're proposing fully transparent areas in PNG thumbnails to be encoded as #ffffff00 instead of #00000000? -- El Grafo (talk) 11:12, 4 May 2023 (UTC)Reply[reply]
Something like that, yes (I'm not a bitmap format expert). This should be a no-effect change to anything that supports transparency, and an improvement to those that don't. Andy Dingley (talk) 11:32, 4 May 2023 (UTC)Reply[reply]

Downloading images in OpenSeadragon?[edit]

does anyone have experience in getting the original hi res images inside OpenSeadragon? i'm trying to download the source files (dont know if they are images or pdfs) of old hk newspapers, like https://mmis.hkpl.gov.hk/coverpage/-/coverpage/view?_coverpage_WAR_mmisportalportlet_hsf=Hong+Kong+Daily+Press&_coverpage_WAR_mmisportalportlet_actual_q=%28%20all_dc.title%3A%28%22Hong%5C%20Kong%5C%20Daily%5C%20Press%22%29%29%20AND+%28%20verbatim_dc.collection%3A%28%22Old%5C%20HK%5C%20Newspapers%22%29%29&_coverpage_WAR_mmisportalportlet_sort_field=dc.publicationdate_bsort&p_r_p_-1078056564_c=QF757YsWv5%2F6rByrziBvQzxON8TH4X4a&_coverpage_WAR_mmisportalportlet_o=0&_coverpage_WAR_mmisportalportlet_sort_order=asc . RZuo (talk) 12:07, 3 May 2023 (UTC)Reply[reply]

Tech News: 2023-19[edit]

MediaWiki message delivery 00:34, 9 May 2023 (UTC)Reply[reply]

UploadWizard Flickr uploading feature[edit]

When using the feature that allows you to upload Flickr images to commons with UploadWizard, UploadWizard does not state the title of a Flickr work. The versions of cc-by and cc-by-sa that flickr uses clear state that when attributing a work you need to provide "the title of the Work if supplied", Why doesn't UploadWizard do this? Flickr2commons already has this feature... Teneab (talk) 15:40, 10 May 2023 (UTC)Reply[reply]

Best way to search for a user's assessed uploads?[edit]

by "assessed uploads" i mean "Featured pictures, Quality images, or Valued images". Help:FastCCI can do this on a category. what if i want to do that about a user? if the user didnt put his/her uploads in a category.

i only know using CirrusSearch tricks to find one kind at a time, but dont know a way to find all 3 kinds (and possibly featured media and so on) at the same time. RZuo (talk) 16:02, 10 May 2023 (UTC)Reply[reply]

@RZuo: perhaps PetScan with union of image categories and which link to specific user page: [22] MKFI (talk) 08:39, 11 May 2023 (UTC)Reply[reply]
@RZuo: in Wiki's advanced search function, have the main search look for the author's name (as it would appear in the description template), while simultaneously looking for featured_pictures quality_images valued_images in the advanced search parameter "one of these words". --HyperGaruda (talk) 19:53, 15 May 2023 (UTC)Reply[reply]

Demande pour téléverser un fichier avec l'extansion .odt[edit]

Bonjour,

J'aimerais téléverser un fichier odt contenant une image, mais un message s'affiche, exposant qu'il n'est pas possible de verser des fichiers avec l'extension .odt, pourquoi? en effet, j'ai moi-même créé ce fichier, je ne vois donc pas la raison de ce refus.

Bien cordialement et en espérant être assez explicite, Yulan de Rê (talk) 17:31, 14 May 2023 (UTC)Reply[reply]

odt files are not accepted. see com:file types.
please upload the image directly using Special:UploadWizard.
google translation:
les fichiers odt ne sont pas acceptés. voir Commons:File_types/fr.
veuillez télécharger l'image directement à l'aide de Special:UploadWizard.--RZuo (talk) 18:31, 14 May 2023 (UTC)Reply[reply]
@Yulan de Rê: ça veut dire qu'il faut extraire l'image du fichier .odt et l'enregistrer au format .jpg (photos) ou .svg/.png (images schématiques). J'espère bien que vous êtes aussi l'auteur original de l'image et pas seulement du fichier .odt. Si non, ça peut être regardé comme une violation des droits d'auteur. --HyperGaruda (talk) 20:12, 15 May 2023 (UTC)Reply[reply]
Merci @HyperGaruda! Bon après-midi. Yulan de Rê (talk) 10:34, 16 May 2023 (UTC)Reply[reply]

Tech News: 2023-20[edit]

MediaWiki message delivery 21:42, 15 May 2023 (UTC)Reply[reply]

How to rename files?[edit]

Hi

How can I change filesnames?

Like changing file:Waverly Council Chambers.jpg to "Waverley Council Chambers.jpg"

How can I change folders' names?

Like changing folder's name of "Category:Centennial Park, Woollahra Gate from Oxford Street" to "Category:Centennial Park, Woollahra Gates from Oxford Street". I also need to change Category:The Offerings of War and Peace to "Category:The Offerings of War and Peace statues". Shkuru Afshar (talk) 12:56, 17 May 2023 (UTC)Reply[reply]

@Shkuru Afshar: See:
respectively. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 14:28, 21 May 2023 (UTC)Reply[reply]

Any way to let certain gadget add edited pages to watchlist with expiry date?[edit]

for example, as a filemover, i wanna add both file:oldname.xyz and file:newname.xyz to my watchlist and let them expire after 1 month, so as to monitor them for a short time after my edits. is there a way to make certain gadgets do this? i think i've seen gadgets adding pages to watchlist, but without expiry. RZuo (talk) 11:08, 19 May 2023 (UTC)Reply[reply]

I recently uploaded a file: File:Manchester Metropolitan University Business School.png, and it seems to have quite a bit of Warning Symbol – Chromatic Aberration.svg chromatic aberration could anyone fix this for me? The target areas are mainly on the left, including the person's body, and the top left of the image's corner. Thanks, Please use the {{Reply to}} template when replying. 多多123 13:43, 21 May 2023 (UTC)Reply[reply]

@多多123: Ask at: Commons:Graphic Lab. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 14:29, 21 May 2023 (UTC)Reply[reply]
Thanks. 多多123 15:35, 21 May 2023 (UTC)Reply[reply]

Vertical-oriented text created in Inkscape not visible[edit]

I created File:Four Sons of Horus coffin diagram.svg in Inkscape. The second half of the diagram, the lower one, contains four columns of vertical text (the individual letters are upright, but they're arranged vertically). But they're not visible in the uploaded version. Does anyone know why this is, and what can be done about it? A. Parrot (talk) 21:12, 21 May 2023 (UTC)Reply[reply]

Upload wizard bug?[edit]

If I have uploaded an image and described the file, and I click submit, it says some mistake happens, but then I must just click on and go forward with the process ignoring that there was a mistake, and then it actually works. In the end all images are up. And since I am here, when I upload images first, it usually says I am already uploading a file, but that's normal for my workflow. But the one after the description is new, anyway I am glad for any help, if there is any. Paradise Chronicle (talk) 05:48, 22 May 2023 (UTC)Reply[reply]