Page MenuHomePhabricator

logos/manage.py does not find 1.5x logo
Closed, ResolvedPublic

Description

mango@tuxedo-os:~/mediawiki/mediawiki-config/logos$ tox -e logos -- update thwikimedia
logos: commands[0] logos> python ./logos/manage.py update thwikimedia
Traceback (most recent call last):
  File "/home/mango/mediawiki/mediawiki-config/./logos/manage.py", line 658, in <module>
    main()
  File "/home/mango/mediawiki/mediawiki-config/./logos/manage.py", line 651, in main
    update(data, args.wiki, args.variant)
  File "/home/mango/mediawiki/mediawiki-config/./logos/manage.py", line 529, in update
    download(commons, name)
  File "/home/mango/mediawiki/mediawiki-config/./logos/manage.py", line 146, in download
    f"{name}-1.5x.png": info["responsiveUrls"]["1.5"].replace("203px", "202px"),
                        ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^
KeyError: '1.5'
logos: exit 1 (0.49 seconds) /home/mango/mediawiki/mediawiki-config> python ./logos/manage.py update thwikimedia pid=141221
  logos: FAIL code 1 (0.51=setup[0.02]+cmd[0.49] seconds)
  evaluation failed :( (0.55 seconds)
mango@tuxedo-os:~/mediawiki/mediawiki-config/logos$

I did check and the 2x version is being found.

Event Timeline

The api request made gives the following response.

{
    "continue": {
        "iistart": "2018-09-19T23:57:16Z",
        "continue": "||"
    },
    "query": {
        "pages": [
            {
                "pageid": 72880422,
                "ns": 6,
                "title": "File:Wikimedia Thailand-Logo-BW.svg",
                "imagerepository": "local",
                "imageinfo": [
                    {
                        "thumburl": "https://upload.wikimedia.org/wikipedia/commons/thumb/8/8f/Wikimedia_Thailand-Logo-BW.svg/250px-Wikimedia_Thailand-Logo-BW.svg.png",
                        "thumbwidth": 135,
                        "thumbheight": 101,
                        "responsiveUrls": {
                            "2": "https://upload.wikimedia.org/wikipedia/commons/thumb/8/8f/Wikimedia_Thailand-Logo-BW.svg/330px-Wikimedia_Thailand-Logo-BW.svg.png"
                        },
                        "url": "https://upload.wikimedia.org/wikipedia/commons/8/8f/Wikimedia_Thailand-Logo-BW.svg",
                        "descriptionurl": "https://commons.wikimedia.org/wiki/File:Wikimedia_Thailand-Logo-BW.svg",
                        "descriptionshorturl": "https://commons.wikimedia.org/w/index.php?curid=72880422"
                    }
                ]
            }
        ]
    }
}

I have encountered this before, changing logo size less than 135px width and 155px height works, and previously it used to give error message something like logo is taller than 155px, please resize it

I same error for https://gerrit.wikimedia.org/r/c/operations/mediawiki-config/+/1189616 after resize of commons file https://commons.wikimedia.org/wiki/File:Wikiquote-logo-ms.svg logo generated without any error

I think the script has to be updated to properly work with T360589.

I'm experiencing the same error for T391009 and T405147. It's impossible to find the 1.5x version and I cannot update any logo.

@Anoop The "logo is taller than 155px, please resize it" error is because the logo doesn't comply with the rule, so when the script reduces it to 135px wide (default and mandatory measure) it must be equal to or less than 155px tall.

Btw, since it seems working with small logos (I already tried), if this requires a lot of work we may still try resizing the logos for the new tasks!

Restricted Application added a subscriber: alaa. · View Herald TranscriptDec 6 2025, 7:11 PM

Change #1217282 had a related patch set uploaded (by Pppery; author: Pppery):

[operations/mediawiki-config@master] Logos: Destandardize thumbnail sizes, handle missing responsive URLs

https://gerrit.wikimedia.org/r/1217282

Change #1217282 merged by jenkins-bot:

[operations/mediawiki-config@master] Logos: Handle missing responsive URLs, manually modify thumbnail sizes to avoid $wgThumbnailSteps

https://gerrit.wikimedia.org/r/1217282

Mentioned in SAL (#wikimedia-operations) [2025-12-18T21:06:55Z] <tgr@deploy2002> Started scap sync-world: Backport for [[gerrit:1217790|Remove LoggedOut cookie logic (T142542)]], [[gerrit:1219588|Turn on Parsoid Read Views on itwiki (T413084)]], [[gerrit:rOPUP121728222dda|Logos: Handle missing responsive URLs, manually modify thumbnail sizes to avoid $wgThumbnailSteps (T405169)]]

Mentioned in SAL (#wikimedia-operations) [2025-12-18T21:08:54Z] <tgr@deploy2002> pppery, tgr, cscott: Backport for [[gerrit:1217790|Remove LoggedOut cookie logic (T142542)]], [[gerrit:1219588|Turn on Parsoid Read Views on itwiki (T413084)]], [[gerrit:rOPUP121728222dda|Logos: Handle missing responsive URLs, manually modify thumbnail sizes to avoid $wgThumbnailSteps (T405169)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2025-12-18T21:13:23Z] <tgr@deploy2002> Finished scap sync-world: Backport for [[gerrit:1217790|Remove LoggedOut cookie logic (T142542)]], [[gerrit:1219588|Turn on Parsoid Read Views on itwiki (T413084)]], [[gerrit:rOPUP121728222dda|Logos: Handle missing responsive URLs, manually modify thumbnail sizes to avoid $wgThumbnailSteps (T405169)]] (duration: 06m 28s)