Page MenuHomePhabricator

Set custom logo for azwikimedia and vewikimedia
Closed, ResolvedPublic

Description

azwikimedia and vewikimedia were created in T306015 and T320890.

When I try to generate the logos for vewikimedia I get the following error.

1alec@laptop:~/mediawiki/mediawiki-config$ git diff
2diff --git a/logos/config.yaml b/logos/config.yaml
3index 30e8b1ca8..5be632958 100644
4--- a/logos/config.yaml
5+++ b/logos/config.yaml
6@@ -3388,6 +3388,8 @@ Wikivoyage:
7 uawikimedia:
8 no_1_5x: true
9 no_2x: true
10+ vewikimedia:
11+ commons: 'File:Wikimedia Venezuela logo negro.svg'
12 wbwikimedia:
13 comment: T162510
14 comment_1_5x: T162510
15alec@laptop:~/mediawiki/mediawiki-config$ tox -e logos -- update vewikimedia
16logos installed: certifi==2022.12.7,charset-normalizer==2.0.12,idna==3.4,PyYAML==6.0,requests==2.28.0,scour==0.38.2,six==1.16.0,types-PyYAML==6.0.12.8,types-requests==2.28.11.15,types-urllib3==1.26.25.8,urllib3==1.26.14
17logos run-test-pre: PYTHONHASHSEED='957334553'
18logos run-test: commands[0] | python ./logos/manage.py update vewikimedia
19Saved vewikimedia.png
20Traceback (most recent call last):
21 File "/home/alec/mediawiki/mediawiki-config/./logos/manage.py", line 647, in <module>
22 main()
23 File "/home/alec/mediawiki/mediawiki-config/./logos/manage.py", line 640, in main
24 update(data, args.wiki, args.variant)
25 File "/home/alec/mediawiki/mediawiki-config/./logos/manage.py", line 518, in update
26 download(commons, name)
27 File "/home/alec/mediawiki/mediawiki-config/./logos/manage.py", line 154, in download
28 subprocess.check_call(
29 File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
30 raise CalledProcessError(retcode, cmd)
31subprocess.CalledProcessError: Command '['pngquant', '--skip-if-larger', '--speed', '3', '--quality', '80-100', 'vewikimedia.png', '--ext', '.png', '--force']' returned non-zero exit status 98.
32ERROR: InvocationError for command /home/alec/mediawiki/mediawiki-config/.tox/logos/bin/python ./logos/manage.py update vewikimedia (exited with code 1)
33___________________________________________________________________________ summary ____________________________________________________________________________
34ERROR: logos: commands failed
35alec@laptop:~/mediawiki/mediawiki-config$

The same error shows up for azwikimedia. I don't get this issue when trying to generate the logos for a non-chapter wiki.

Maybe someone more familier with logos could take a look?

Event Timeline

Hi @Zabe, I got the same result! I'm trying to understand why, but the issue should be due to the file. If you try, for example, 'File:Wikimedia Venezuela logo.svg', you have no problem when running tox!

vewikimedia.png:
  read 5KB file
  made histogram...253 colors found
  eliminated opaque tRNS-chunk entries...252 entries transparent
  mapped image to new colors...MSE=0.000 (Q=100)
  writing 253-color image as vewikimedia.png
  file exceeded expected size of 4KB

This is caused by the "--skip-if-larger" param (#157)

(man pngquant)
--skip-if-larger
         If conversion results in a file larger than the original, the image won't be saved
         and pngquant will exit with status code 98.  Additionally, file size gain must be
         greater than the amount of quality lost. If quality drops by 50%, it will expect
         50% file size reduction to consider it worthwhile.

Change 894129 had a related patch set uploaded (by Stang; author: Stang):

[operations/mediawiki-config@master] logos: Error handling if pngquant's output is larger than original

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

Oh thanks! I Was just wondering what that skip-if-larger was!

vewikimedia.png:
  read 5KB file
  made histogram...253 colors found
  eliminated opaque tRNS-chunk entries...252 entries transparent
  mapped image to new colors...MSE=0.000 (Q=100)
  writing 253-color image as vewikimedia.png
  file exceeded expected size of 4KB

This is caused by the "--skip-if-larger" param (#157)

(man pngquant)
--skip-if-larger
         If conversion results in a file larger than the original, the image won't be saved
         and pngquant will exit with status code 98.  Additionally, file size gain must be
         greater than the amount of quality lost. If quality drops by 50%, it will expect
         50% file size reduction to consider it worthwhile.

Change 894143 had a related patch set uploaded (by Zabe; author: Zabe):

[operations/mediawiki-config@master] Add logo for azwikimedia and vewikimedia

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

Change 894129 merged by jenkins-bot:

[operations/mediawiki-config@master] logos: Error handling if pngquant's output is larger than original

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

Change 894143 merged by jenkins-bot:

[operations/mediawiki-config@master] Add logo for azwikimedia and vewikimedia

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

Mentioned in SAL (#wikimedia-operations) [2023-03-06T15:14:43Z] <zabe@deploy2002> Started scap: Backport for [[gerrit:894143|Add logo for azwikimedia and vewikimedia (T331177)]]

Mentioned in SAL (#wikimedia-operations) [2023-03-06T15:16:31Z] <zabe@deploy2002> zabe: Backport for [[gerrit:894143|Add logo for azwikimedia and vewikimedia (T331177)]] synced to the testservers: mwdebug1001.eqiad.wmnet, mwdebug2001.codfw.wmnet, mwdebug1002.eqiad.wmnet, mwdebug2002.codfw.wmnet

Mentioned in SAL (#wikimedia-operations) [2023-03-06T15:23:16Z] <zabe@deploy2002> Finished scap: Backport for [[gerrit:894143|Add logo for azwikimedia and vewikimedia (T331177)]] (duration: 08m 33s)

Zabe claimed this task.
Zabe removed Zabe as the assignee of this task.
Zabe removed a project: Patch-For-Review.