Jump to content

Module talk:Main page image

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by ProcrastinatingReader (talk | contribs) at 19:39, 13 August 2020 (Calculate by area: Replying to Coffeeandcrumbs (using reply-link)). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Calculate by area

ProcrastinatingReader, now that we have overcome the challenge of adoption. I wonder if there is not a better way of calculating size. The best way to calculate the image size is actually by area. Could you rewrite this module to calculate the width size that would return an image occupying a surface area equal to 140x140 = 19,600? Note, this is approximately the same size as 120x160 or 160x120 = 19,200. --- C&C (Coffeeandcrumbs) 15:37, 11 August 2020 (UTC)[reply]

Coffeeandcrumbs, sorry, I don't quite follow. How would this work? And what's the visible difference over the current way of doing it? And how would it know whether to be upright or not since both 120x160 and 160x120 are 19,200 pixels? ProcrastinatingReader (talk) 11:06, 12 August 2020 (UTC)[reply]
ProcrastinatingReader, I created Module:Main page image/sandbox to show how it could work. My hope is to address cases where the image is very wide or very tall. --- C&C (Coffeeandcrumbs) 17:25, 12 August 2020 (UTC)[reply]
ProcrastinatingReader Did you have a chance to review the new code in the sandbox. If you have no objections, I am going to make a request to implement it. --- C&C (Coffeeandcrumbs) 19:24, 13 August 2020 (UTC)[reply]
Coffeeandcrumbs, yes, sorry. I was fiddling around with how it would look with the TFA yesterday, see User:ProcrastinatingReader/sandbox3. Code wise it's fine. Functionality wise, I'd only note that a) it can result in varying widths (which I suppose is the point) and b) for some dimensions, like the example in sandbox, can be fairly small and result in the caption looking a bit messy. ProcrastinatingReader (talk) 19:39, 13 August 2020 (UTC)[reply]