Module talk:Main page image: Difference between revisions

Content deleted Content added
Calculate by area: Replying to Coffeeandcrumbs (using reply-link)
 
(34 intermediate revisions by 9 users not shown)
Line 5:
::{{u|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. ---&nbsp;[[User talk:Coffeeandcrumbs|<span style="color:blue;">C</span>]]&amp;[[Special:Contributions/Coffeeandcrumbs|<span style="color:#663366;">C</span>&nbsp;(]][[User talk:Coffeeandcrumbs|<span style="color:#ba0000">Coffeeandcrumbs</span>]]) 17:25, 12 August 2020 (UTC)
:::{{u|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. ---&nbsp;[[User talk:Coffeeandcrumbs|<span style="color:blue;">C</span>]]&amp;[[Special:Contributions/Coffeeandcrumbs|<span style="color:#663366;">C</span>&nbsp;(]][[User talk:Coffeeandcrumbs|<span style="color:#ba0000">Coffeeandcrumbs</span>]]) 19:24, 13 August 2020 (UTC)
::::{{u|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 (seems to vary for different browsers, looks worse in Safari than Chrome for me). [[User:ProcrastinatingReader|ProcrastinatingReader]] ([[User talk:ProcrastinatingReader|talk]]) 19:39, 13 August 2020 (UTC)
:::::{{u|ProcrastinatingReader}}, I recommend you install [[User:SD0001/sandbox4.js]]. It will let you preview template changes on live pages without having to create such sandboxes.
:::::
:::::As for your sandbox3, note that [[Wikipedia:Today's featured article/August 12, 2020|I manipulated that original TFA blurb]] using <code><nowiki><br /></nowiki></code> and <code><nowiki>width=x222</nowiki></code>. We will have to continue using your override feature to address such extreme cases. ---&nbsp;[[User talk:Coffeeandcrumbs|<span style="color:blue;">C</span>]]&amp;[[Special:Contributions/Coffeeandcrumbs|<span style="color:#663366;">C</span>&nbsp;(]][[User talk:Coffeeandcrumbs|<span style="color:#ba0000">Coffeeandcrumbs</span>]]) 19:59, 13 August 2020 (UTC)
::::::Fair point. Code wise looks fine to me - good work, and nice formula! I've made a very small edit (since the variable is already declared). [[User:ProcrastinatingReader|ProcrastinatingReader]] ([[User talk:ProcrastinatingReader|talk]]) 20:07, 13 August 2020 (UTC)
=== Request ===
{{Edit fully-protected|ans=y}}
Please replace the current code with the version in the sandbox: [[Module:Main page image/sandbox]]. ---&nbsp;[[User talk:Coffeeandcrumbs|<span style="color:blue;">C</span>]]&amp;[[Special:Contributions/Coffeeandcrumbs|<span style="color:#663366;">C</span>&nbsp;(]][[User talk:Coffeeandcrumbs|<span style="color:#ba0000">Coffeeandcrumbs</span>]]) 20:23, 13 August 2020 (UTC)
:I think, since this would result in a visual change to the Main Page (ie, in image sizes), this may require a discussion at [[Talk:Main Page]]. [[User:ProcrastinatingReader|ProcrastinatingReader]] ([[User talk:ProcrastinatingReader|talk]]) 14:57, 28 August 2020 (UTC)
::I have posted a notice at [[Talk:Main Page]]. ---&nbsp;[[User talk:Coffeeandcrumbs|<span style="color:blue;">C</span>]]&amp;[[Special:Contributions/Coffeeandcrumbs|<span style="color:#663366;">C</span>&nbsp;(]][[User talk:Coffeeandcrumbs|<span style="color:#ba0000">Coffeeandcrumbs</span>]]) 22:04, 28 August 2020 (UTC)
:::Disabled request pending outcome of dicussion &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 20:19, 29 August 2020 (UTC)
::::{{u|MSGJ}} and {{u|ProcrastinatingReader}}, it would appear no one else cares. The notice was archived after three days. ---&nbsp;[[User talk:Coffeeandcrumbs|<span style="color:blue;">C</span>]]&amp;[[Special:Contributions/Coffeeandcrumbs|<span style="color:#663366;">C</span>&nbsp;(]][[User talk:Coffeeandcrumbs|<span style="color:#ba0000">Coffeeandcrumbs</span>]]) 18:43, 1 September 2020 (UTC)
:::::I've implemented the change in the sandbox &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 06:52, 8 September 2020 (UTC)
 
== Fix some script errors ==
 
{{edit fully-protected|answered=yes}}
Please pull in changes from sandbox (specifically [[Special:Diff/977330810/986765585]]) to fix some script errors, e.g., to remove [[Portal:California/Selected article/Layout]] from [[:Category:Pages with script errors]]. Thank you, —[[User:Uzume|Uzume]] ([[User talk:Uzume|talk]]) 21:53, 2 November 2020 (UTC)
:[[File:Yes check.svg|20px|link=|alt=]] '''Done'''<!-- Template:EP --> &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 13:48, 4 November 2020 (UTC)
 
== weird problem ==
 
{{ping|ProcrastinatingReader}} take a look at [[Special:PermaLink/995467810]] with Firefox if you can? The first image (which is on MP right now) looks horrible on my screen, see screenshot below. Not using this module seems to make the problem go away.
 
[[File:PermaLink995467810.png]]
{{clear}}
:— [[User:Xaosflux|<span style="color:#FF9933; font-weight:bold; font-family:monotype;">xaosflux</span>]] <sup>[[User talk:Xaosflux|<span style="color:#009933;">Talk</span>]]</sup> 04:58, 21 December 2020 (UTC)
 
:{{ping|Cwmhiraeth}} FYI, I replaced the DYK image you had from queue1 with a non transparent version that seems to have at least temporarily fixed the MP distoration, please also see above if you have additional information. — [[User:Xaosflux|<span style="color:#FF9933; font-weight:bold; font-family:monotype;">xaosflux</span>]] <sup>[[User talk:Xaosflux|<span style="color:#009933;">Talk</span>]]</sup> 05:14, 21 December 2020 (UTC)
:: It does look strange. {{Ping|Ravenpuff}} seems to have made the change to the image with [https://en.wikipedia.org/w/index.php?title=Template:Did_you_know/Preparation_area_1&diff=993985104&oldid=993983599 this edit]. [[User:Cwmhiraeth|Cwmhiraeth]] ([[User talk:Cwmhiraeth|talk]]) 06:03, 21 December 2020 (UTC)
::: Wasn't trying to "blame" anyone (inc Ravenpuff now) - just an FYI in case anyone wanted to know why I jumped in to making a MP change. — [[User:Xaosflux|<span style="color:#FF9933; font-weight:bold; font-family:monotype;">xaosflux</span>]] <sup>[[User talk:Xaosflux|<span style="color:#009933;">Talk</span>]]</sup> 06:29, 21 December 2020 (UTC)
:[[Special:Permalink/995467810]] looks normal to me on Firefox 84.0 - no extensions, default theme. [[User:ProcrastinatingReader|ProcrastinatingReader]] ([[User talk:ProcrastinatingReader|talk]]) 13:22, 21 December 2020 (UTC)
:I've also tried to preview [[User:ProcrastinatingReader/sandbox6]] (modified fork of [[T:DYK]]) on the MP and cannot reproduce. [[User:ProcrastinatingReader|ProcrastinatingReader]] ([[User talk:ProcrastinatingReader|talk]]) 13:46, 21 December 2020 (UTC)
::{{re|ProcrastinatingReader}} hmm, can't figure out the cause yet -- but it doesn't seem to be the width calculator module after more testing (c.f. [[Special:PermaLink/995540876]] - I'm only seeing the image corrupted when width=154). — [[User:Xaosflux|<span style="color:#FF9933; font-weight:bold; font-family:monotype;">xaosflux</span>]] <sup>[[User talk:Xaosflux|<span style="color:#009933;">Talk</span>]]</sup> 16:33, 21 December 2020 (UTC)
:::FYI was on ERRORS as well (don't think they know this is how it was fixed - but it's at least not a xaosflux-only problem!) ([[Special:PermaLink/995517095]]). — [[User:Xaosflux|<span style="color:#FF9933; font-weight:bold; font-family:monotype;">xaosflux</span>]] <sup>[[User talk:Xaosflux|<span style="color:#009933;">Talk</span>]]</sup> 19:59, 21 December 2020 (UTC)
::::Strange. Also strange that I cannot reproduce.
::::{{tq|I'm only seeing the image corrupted when width{{=}}154}} Curious: if you manually inspect element Test2 (which isn't broken) to width 154 it breaks? If no, does changing it to 154 in the source break it? If yes to either, how about 150 or 152? [[User:ProcrastinatingReader|ProcrastinatingReader]] ([[User talk:ProcrastinatingReader|talk]]) 20:31, 21 December 2020 (UTC)
:::::{{re|ProcrastinatingReader}} and only at 154. 140,153,155 all are fine. — [[User:Xaosflux|<span style="color:#FF9933; font-weight:bold; font-family:monotype;">xaosflux</span>]] <sup>[[User talk:Xaosflux|<span style="color:#009933;">Talk</span>]]</sup> 03:25, 22 December 2020 (UTC)
 
== Image width calculation for .ogg file results in "-nanpx" ==
 
This image call is currently on the main page: <code><nowiki>{{main page image/OTD|File:O Canada instrumental 1916.ogg|"O Canada"}}</nowiki></code>. It results in <code><nowiki>[[File:O Canada instrumental 1916.ogg|-nanpx |"O Canada" ]]</nowiki></code>. My suspicion is that the automatic width calculation in this module may be causing this invalid size specification. If so, some error-checking and a default value may be needed here. To verify this, try <code><nowiki>{{#invoke:Main_page_image|width|O Canada instrumental 1916.ogg}}</nowiki></code>; when I do it, the result is <code>-nan</code>. Pinging {{U|MSGJ}}, who made changes to that code most recently. – [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 01:15, 24 June 2021 (UTC)
 
:{{Ping|Coffeeandcrumbs}} would you look into this? &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 04:32, 24 June 2021 (UTC)
::{{U|MSGJ}} and {{U|Coffeeandcrumbs}}: This bug still exists in the module. – [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 00:22, 5 November 2021 (UTC)
:::{{U|ProcrastinatingReader}}, do you have time to look at this? I don't see a visible error in [[Wikipedia:Main Page history/2021 June 24|the archived version]] but <code>-nan</code> is in the source code. ---&nbsp;[[User talk:Coffeeandcrumbs|<span style="color:blue;">C</span>]]&amp;[[Special:Contributions/Coffeeandcrumbs|<span style="color:#663366;">C</span>&nbsp;(]][[User:Coffeeandcrumbs|Coffeeandcrumbs]]) 02:39, 5 November 2021 (UTC)
::::This is happening again at [[:Template:Did you know nominations/Boy Scouts of America (march)]]. – [[User:Jonesey95|Jonesey95]] ([[User talk:Jonesey95|talk]]) 06:20, 29 January 2022 (UTC)
 
== Protected edit request on 4 November 2021 ==
 
{{edit fully-protected|Module:Main page image|answered=yes}}
Please copy change [[Special:Diff/1053614141]] from the samdbox to this template. It resolves the issues seen at [[Template:Main page image/DYK/testcases]] where a red Lua error appears if the image parameter is removed. [[User:GKFX]]<sup>[[User talk:GKFX|talk]]</sup> 23:32, 4 November 2021 (UTC)
:{{done}}<!-- Template:EP --> &mdash;&nbsp;Martin <small>([[User:MSGJ|MSGJ]]&nbsp;·&nbsp;[[User talk:MSGJ|talk]])</small> 05:59, 5 November 2021 (UTC)
 
== Protected edit request on 2022 September 8 ==
 
{{edit fully-protected|answered=yes}}
The formula on line 16 appears to be convoluted? It seems to be the equivalent of <code>math.floor(140 * math.sqrt( page.file.width / page.file.height ) + 0.5)</code>, which reads much more simply to me. The new code also makes it obvious to passers-by what exactly this code is trying to do: downsize the image to an area of 19,600 pixels, preserving aspect ratio. Can the formula on line 16 be changed to the requested code above? [[user:theleekycauldron|theleekycauldron]] ([[user talk:theleekycauldron|talk]] • [[Special:Contributions/Theleekycauldron|contribs]]) (she/her) 02:46, 9 September 2022 (UTC)
:{{done}}<!-- Template:EP --> [[User:DatGuy|DatGuy]]<sup>[[User talk:DatGuy|Talk]]</sup><sub>[[Special:Contributions/DatGuy|Contribs]]</sub> 13:42, 9 September 2022 (UTC)