Last modified: 2013-10-28 10:08:45 UTC
3f5d41d4135740573f642 (bug 32987) introduced support for lang= on localised SVGs. Thumbnails are generated in this form: [[File:Gerrit_patchset_25838_test.svg|thumb|lang=de]] https://upload.wikimedia.org/wikipedia/commons/thumb/4/45/Gerrit_patchset_25838_test.svg/langde-345px-Gerrit_patchset_25838_test.svg.png mw.Title.newFromImg({src:'https://upload.wikimedia.org/wikipedia/commons/thumb/4/45/Gerrit_patchset_25838_test.svg/langde-345px-Gerrit_patchset_25838_test.svg.png'}); > File:Langde-345px-Gerrit patchset 25838 test.svg.png Since both mw.Title.newFromImg and localised SVG thumbnails are introduced recently, this is a 1.22-alpha cycle regression that must be addressed before release.
So to be clear, mw.Title.newFromImg() tries to recover a title object from an image filename? This should just be a case of teaching it how to handle custom language SVGs?
See also: https://commons.wikimedia.org/w/index.php?title=MediaWiki%3ACommon.js&diff=107578007&oldid=105629412
(In reply to comment #1) > So to be clear, mw.Title.newFromImg() tries to recover a title object from an > image filename? This should just be a case of teaching it how to handle > custom > language SVGs? Yes.
The bug here seems to be that these links are being done on the client side not the server side. (In reply to comment #1) > So to be clear, mw.Title.newFromImg() tries to recover a title object from an > image filename? This should just be a case of teaching it how to handle > custom > language SVGs? It should look at the directory name, not the actual filename. The format of the filename varries depending on which extensions are installed.additionally, Lonngish filenames even get shortened to things like 120px-thumbnail.jpg (change ext as appropriate). This is nothing new...
Change 90897 had a related patch set uploaded by Jarry1250: Generalise filename-matching in mediawiki.Title.newFromImg() https://gerrit.wikimedia.org/r/90897
> > It should look at the directory name, not the actual filename. The format of > the filename varries depending on which extensions are > installed.additionally, > Lonngish filenames even get shortened to things like 120px-thumbnail.jpg > (change ext as appropriate). This is nothing new... Specific example: https://upload.wikimedia.org/wikipedia/commons/thumb/a/a0/Geschw._Lenders%2C_Hoflieferanten%2C_Leinen-_und_W%C3%A4sche-Ausstattungsmagazin%2C_Modewaaren%2C_Allee-_und_Elberfelderstr.-Ecke_24_%28Adressbuch_der_Oberb%C3%BCrgermeisterei_D%C3%BCsseldorf_f%C3%BCr_das_Jahr_1890%2C_Erster_Theil._S._179%29.jpg/120px-thumbnail.jpg (We do this for any file where the thumbnail is > 160 bytes) Also I'm somewhat doubtful that [^\s\\] actually corresponds to allowed characters (U+1680 for example is allowed in files I believe).
Change 90897 merged by jenkins-bot: mediawiki.Title: Generalise filename-matching in newFromImg https://gerrit.wikimedia.org/r/90897