As title says: If a width larger than the original is called, return original image instead of error.
Version: 1.22.12
Severity: enhancement
As title says: If a width larger than the original is called, return original image instead of error.
Version: 1.22.12
Severity: enhancement
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
thumb.php: Redirect rather than throwing 400 if requested width >= original | mediawiki/core | master | +16 -5 |
How does returning the original help? If you know the size of the original, you can just cap the requested size on the client size. If you don't know the original size, the result will look crappy anyway.
Returning the original image for a practically infinite variety of URLs would AFAIK result in pollution of the varnish cache as the image would have to be stored there for every URL separately.
Check if viewport has enough width to display the 500px image.
Call thumb.php?f=Foo.jpg&w=500 > Displays a 500px thumb or a smaller original
How does returning an error help?
As a quick and dirty workaround, you can use index.php?title=Special:Redirect/file/Foo.jpg&width=500 which will do a redirect if the file is smaller. It probably does not accept all the parameters thumb.php does, though.
Tgr: Thanks, the redirect works.
This ticket in other words: If the referenced file exists, thumb.php should always return an image and no error.
Change 332425 had a related patch set uploaded (by Mholloway):
thumb.php: Redirect rather than throwing 400 if requested width >= original
Change 332425 abandoned by Mholloway:
thumb.php: Redirect rather than throwing 400 if requested width >= original
Reason:
Seems not viable as written. Discussion to be continued on the linked Phab tasks.