Page MenuHomePhabricator

Add "size=fit" mode for images
Closed, ResolvedPublic

Description

Complimentary to "thumb" and "full", "fit" would either display the image as "full" if it fits horizontally within the page or scale it down to fit horizontally exactly.

Event Timeline

swisspol raised the priority of this task from to Needs Triage.
swisspol updated the task description. (Show Details)
swisspol added a subscriber: swisspol.

You can use width=100%. This isn't quite what you're after, because it will also scale up small images.

I'll see if we can do this in CSS with max-width: 100%. If we can't, writing JS for this is probably Wontfix.

max-width: 100% seems to work reasonably well. In effect, D9758 turns "size=full" into "size=fit". (I assume you don't have a use case for the current behavior (scroll all over the place) of "size=full"?)

This solution is better indeed.