Page MenuHomePhabricator

Decimal fractions in image sizes are parsed incorrectly (ignored entirely instead of truncated)
Open, LowPublic

Description

Images with a width containing a decimal dot are parsed incorrectly, width the dot being disregarded (so that [[Image:Foo|3.25px]] will be 325 pixel wide). See for example: http://hu.wikipedia.org/w/index.php?title=User_vita:Tgr&diff=prev&oldid=3050910

Using fractions in image sizes does not make much sense, nevertheless it is used by a number of people (especially in signatures), and when a lot of images suddenly increase by one or two orders of magnitude, the result is not pretty. (Note also that CSS does allow for such sizes: http://www.w3.org/TR/REC-CSS2/syndata.html#value-def-length )


Version: unspecified
Severity: normal

Details

Reference
bz13650

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:07 PM
bzimport set Reference to bz13650.
bzimport added a subscriber: Unknown Object (MLST).

Correction: it does not only disregard the decimal dot, but the whole width parameter. The image appears at its original size.

Well, that'd be because it's invalid input -- now that we have improved the input validation, it's rejected.

We could perhaps allow them; they'd still get rounded off of course.

matmarex renamed this task from decimal fractions in image sizes are parsed incorrectly to Decimal fractions in image sizes are parsed incorrectly (ignored entirely instead of truncated).Aug 30 2015, 10:37 PM
matmarex set Security to None.
matmarex removed a subscriber: wikibugs-l-list.

This is still valid, although the linked example doesn't exhibit the issue because the file was changed since this bug was filed.