Last modified: 2014-02-26 18:21:27 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T53628, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 51628 - Images specified with size foopxpx render at native size
Images specified with size foopxpx render at native size
Status: RESOLVED FIXED
Product: Parsoid
Classification: Unclassified
General (Other open bugs)
unspecified
All All
: Normal normal
: ---
Assigned To: C. Scott Ananian
:
: 51826 51845 54371 (view as bug list)
Depends on:
Blocks: 54844
  Show dependency treegraph
 
Reported: 2013-07-18 18:14 UTC by Chris McKenna
Modified: 2014-02-26 18:21 UTC (History)
12 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Chris McKenna 2013-07-18 18:14:35 UTC
If a stub template includes an image size declaration that includes "px" then that image is shown at native resolution in the editor.

This was observed with [[Template:Cornwall-stub]] which originally had the code:
{{asbox
| image     = Flag of Cornwall.svg
| pix       = 30px
| subject   = [[Cornwall]]
| category  = Cornwall stubs
| name      = Template:Cornwall-stub
}}

When the "pix" parameter was changed to just "30" [https://en.wikipedia.org/w/index.php?title=Template:Cornwall-stub&diff=564819917&oldid=547286019] as was used by e.g. [[Template:Nigeria-stub]] the image size was displayed correctly. The icon has been rendering at correct size when rendered for reading, presumably since [https://en.wikipedia.org/w/index.php?title=Template:Cornwall-stub&diff=next&oldid=235904748 2009]. 

Interestingly it renders as intended in VE when the template is initially placed, but does on every subsequent time it's opened in VE.

Feel free to use [[User:Thryduulf/stubtemplate]] for testing (I'll leave it up at least until this bug is closed) as I have altered the actual Cornwall-stub template.
Comment 1 Chris McKenna 2013-07-18 21:46:31 UTC
I've just been pointed to an older discussion about this issue at https://en.wikipedia.org/wiki/Wikipedia:VisualEditor/Feedback/Archive_2013_07#Problem_with_image_and_other_information_in_an_infobox
Comment 2 Roan Kattouw 2013-07-23 01:48:19 UTC
*** Bug 51845 has been marked as a duplicate of this bug. ***
Comment 4 Roan Kattouw 2013-07-23 02:55:09 UTC
*** Bug 51826 has been marked as a duplicate of this bug. ***
Comment 5 Gabriel Wicke 2013-08-16 01:02:29 UTC
We are supporting localized option patterns. In this case we get something like $1px, which does not match 30pxpx. We need to investigate why this works in the PHP parser, but not in Parsoid.
Comment 6 Chris McKenna 2013-10-04 23:43:13 UTC
*** Bug 54371 has been marked as a duplicate of this bug. ***
Comment 7 Kelson [Emmanuel Engelhart] 2013-11-21 11:35:07 UTC
Another concrete example:
http://parsoid.wmflabs.org/arwiki/%D9%85%D8%B7%D8%A7%D8%B1_%D8%B3%D9%8A%D8%B3%D9%8A%D9%85%D9%8A%D9%88%D8%AA?oldid=11661406

This bug increases a little bit the size of the offline dumps. I have estimated for example that on arwiki, ~200 pictures (calls) are impacted.

It seems that the PHP related code is the function parseWidthParam() in Parser.php (but this doesn't seems to support things lik "$1px".
Comment 8 C. Scott Ananian 2014-02-19 21:25:50 UTC
Yes, 'pxpx' is actually a "feature".  See bug 13500.

Working on a fix...
Comment 9 ssastry 2014-02-19 21:42:19 UTC
(In reply to C. Scott Ananian from comment #8)
> Yes, 'pxpx' is actually a "feature".  See bug 13500.

groan!
Comment 10 Gerrit Notification Bot 2014-02-19 21:53:14 UTC
Change 114345 had a related patch set uploaded by Cscott:
Support trailing 'pxpx' in image size options.

https://gerrit.wikimedia.org/r/114345
Comment 11 Gerrit Notification Bot 2014-02-19 23:16:25 UTC
Change 114345 merged by jenkins-bot:
Support trailing 'pxpx' in image size options.

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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links