Page MenuHomePhabricator

PAGEBANNER "origin" parameter calculation is not working at all.
Open, Needs TriagePublic

Description

Hello,
I have noticed that PAGEBANNER doesn't change the banner position if origin is inserted. I have tested it in other wikis and the result is the same, but I would like it to be solved in euwiki if possible.

Details

Related Gerrit Patches:
mediawiki/extensions/WikidataPageBanner : masterAllow banner debugging via debug-banner=true

Related Objects

Event Timeline

Theklan created this task.Apr 7 2018, 10:32 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 7 2018, 10:32 AM
Restricted Application added a project: Wikidata. · View Herald TranscriptApr 7 2018, 11:01 AM

@Theklan can you provide some more information? The origin only sets a central focal point so it completely depends on the image resolution and the device you are using whether the result is the same. Can you point us to an example?

You can use my sandbox: https://eu.wikipedia.org/wiki/Lankide:Theklan/Proba_orria

Now the code is {{PAGEBANNER:FakeRealLogSpiral.svg|origin=-1,-1}}

It should be positioned bottom left, but it's not even center center.

Jdlrobson renamed this task from PAGEBANNER is not calculating "origin" parameter in euwiki to PAGEBANNER "origin" parameter calculation is misleading/confusing.Apr 10 2018, 6:33 PM

This looks like it's working as it's currently implemented - I've documented it to the best of my ability here: https://www.mediawiki.org/wiki/Extension:WikidataPageBanner#origin_parameter
It's not very intuitive. Ideally it would be editable via a graphical interface. In terms of your particular problem, I'd suggest creating a copy of the image with whitespace inside the image itself, above/to the sides of the image.

No, the vertical reposition is not happening. The result is the same if you put 1, 0 or -1. So the solution can't be creating a new image (for that, I would make all of them "banner-sized".

Note that if you put origin 1, 0 or -1 (or any other) the css makes, via jquery, a reposition to "top: -XXXXpx", independent of the image shape, being XXXX dependant on the width of the screen, and not the image.

So, inserting 0,0 should be a fully centered image, and it's not.

Theklan renamed this task from PAGEBANNER "origin" parameter calculation is misleading/confusing to PAGEBANNER "origin" parameter calculation is not working at all..Apr 10 2018, 7:06 PM

"it's not working at all" is not accurate. It's doing something, but it's rules are not clear at all.

Playing with it an image of Albert Einstein I do see an impact on https://eu.m.wikipedia.org/wiki/Lankide:Jdlrobson/Draft

With origin |origin=0.125,-0.5

With no origin:

The code appears to be written to make minor corrections to the central focal point, rather than to make major changes Sadly the code is not well documented, tested and in need of a lot of love.
I

Theklan added a comment.EditedApr 10 2018, 7:28 PM

With origin |origin=0.125,-0.5 and with origin |origin=-0.9,0.8 does exactly the same. So it doesn't work at all.

The same result with |origin=0.125,0.3 and with |origin=-0.125,-0.3

If you insert "origin", then yes, it does something... but it's not what it was expected.

It seems that the problem is in jquery, with deprecated calls.

Change 471290 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/WikidataPageBanner@master] Allow banner debugging via debug-banner=true

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

Can someone push this patch?