Template talk:FreedImg

Latest comment: 5 months ago by YuriNikolai in topic missing image template

What is the purpose ... edit

  • Why do we state to use the abbreviated name rather than the full template name? Every time we have an abbreviated template name we add a level of complexity for new users who will have no idea for what FI stands. I could understand if the abbreviated form magically substituted to the expanded form, but that is not the case.
  • On that point, can someone please add to the usage, what is the purpose of FreedImg. At this point of time, we tell them how to implement, not its purpose, or why we would use it.

billinghurst sDrewth 05:37, 3 November 2013 (UTC)Reply

Slow rendering using FI and FSI templates edit

@Billinghurst:, @George Orwell III:, @AuFCL:, @Zoeannl:mw:Help:Images says to use basic [[File:]] format for images. Wikisource templates FI and FIS seem to produce rather slow-loading images on Wikisource. Commons accepts high-resolution images and adjusts them to other wiki image size needs. Can you please discuss your concerns about this and sort out a compromise? Outlier59 (talk) 03:15, 14 April 2016 (UTC)Reply

The FreedImg templates are pretty much an experiment localised to this and a very few other WikiSources. I would be very much surprised if the authors of an mw: link as you have quoted here were even aware of these templates; and even less so likely to reference them even if they did so. Cross-purposes you see: mw: is intended to host documentation applicable to users outside of the WMF empire as well as within it.
As for slow loading, if you are asking such a question then you have probably mis-applied the template in some way. Would you please give some examples of/pointers to actual problems you are having and perhaps a more productive dialogue may result than any of "us" simply guessing what "your" real concerns may happen to be? There is a lot of technical history underlying this in which you may—or may not—be interested; yet a simple regurgitation of the whole thing is almost certainly not what you want—even assuming I (for one) were capable of doing justice to such. AuFCL (talk) 07:35, 14 April 2016 (UTC)Reply
See Evidence as to Man's Place in Nature/Chapter 1 for slow-loading images; see Evidence_as_to_Man's_Place_in_Nature for an image that loads speadily after changing to [[File:]]. After uploading images to Commons with the Upload Wizard, the instructions say to use [[File:]] to link the images to another wiki. I uploaded very large images to Commons. The automatic re-sizing does not appear to be happening when these local templates are used. On Wikipedia (e.g. w:Main_Page, all images download to my browser practically instantly. Outlier59 (talk) 11:03, 14 April 2016 (UTC)Reply
Outlier59 is correct: this template loads the full image from Commons. For example, the iceberg image in the "gravity up" example is >1MB and the size is 2,385px × 3,465px (scaled to 106px × 154px). This is nearly 300x the size of the 106px thumbnail (3.78kB). This is very unfriendly to mobile users, and dramatically inflates ePub export sizes, by orders of magnitude. It's doing thing like making The_Evolution_of_Worlds produce a ePub that's 90MB in size. That only has a couple of dozen images.
I kind of see why it's done (so it can be rescaled by percentage), but it's a bit of a sledgehammer approach. Some Commons images are really big. Inductiveloadtalk/contribs 13:57, 6 January 2020 (UTC)Reply
I think {{large image}} could be a solution here: it loads the image only at the specified size, but it uses CSS to "contain" the image when the parent container element is too small. This produces a 10-30x size reduction in some case. Inductiveloadtalk/contribs 22:02, 22 January 2020 (UTC)Reply

p vs div for captions edit

This template currently uses a paragraph HTML tag and a span to hold the caption. This breaks anything with block formatting, which is done quite a bit (about 200 pages are throwing linter errors):

   pwb.py listpages -linter:html5-misnesting -transcludes:Template:FreedImg -intersect

For example Page:Atlantis Arisen.djvu/403.

A naive change to divs seems like it would work quite well, except for two issues:

  • Several pages apply a line-height style, usually 95%, to the caption, which acts a bit differently
  • There is some global CSS as MediaWiki:Dynimg.css which assumes a paragraph tag. This CSS mostly seems to apply a 94% text size and a slightly smaller line height, which seems like an odd choice to me, because the template docs don't mention that this template will knock off 6% of your text size, and it's not correct for every caption. I would have though leaving this up to the template user is more correct, otherwise the user has to undo the hardcoded values when they are wrong. Inductiveloadtalk/contribs 15:49, 8 July 2019 (UTC)Reply
It gets even better: the unconditionally loaded global CSS uses !important on a ton of rules, making it clobber all sorts of other rules. It uses the same class and relies on tag name to differentiate. And it has the same block vs. inline problem when used with music scores because the scores extension outputs a div that FI tries to wrap inside a p.
I'm actually considering trying to reimplement this from scratch using Lua and TemplateStyles to have a sane migration path away from this template (without breaking the scary number of pages that transclude it). --Xover (talk) 15:19, 18 July 2019 (UTC).Reply
There is also {{Plain_image_with_caption}} which is not widely used and {{Img float}}, Having ONE template or a better a fix that allows for image syntax to be fixed in Mediawiki itself would be a good start. ShakespeareFan00 (talk) 16:44, 18 July 2019 (UTC)Reply
@Xover, that's a much better idea! I shied away from making any real changes for the same reason: 10k pages to check for breakage! I think whatever replaces it should not bring an formatting that's not explicitly part of the interface (e.g. centred captions is fine, having a "silent" 94% text size is not). Inductiveloadtalk/contribs 19:20, 18 July 2019 (UTC)Reply

Multicap option edit

I added a multicap option in the sandbox version to work around some div-span flip concerns..

Please review the sandbox and testcases provided. Thanks. ShakespeareFan00 (talk) 13:46, 9 May 2020 (UTC)Reply

CSS moved from global MediaWiki to TemplateStyles (aka what happened to MediaWiki:Dynimg.css?) edit

To future Wiki-historians, the page MediaWiki:Dynimg.css has been moved to Template:FreedImg/styles.css. This allows maintenance by non-interface-admins and also prevents loading CSS for all pages regardless of need. Inductiveloadtalk/contribs

imgstyle option edit

This is more of a general FI/FIS question as it affects both templates. I noticed that the FI template description has a reference to an imgstyle option, but I could not get it to work. I would eventually like to use the FIS template on this page but that image needs an added border, which could be done with the imgstyle option if it is working. Could someone help out with this? Clay (talk) 05:28, 8 November 2021 (UTC)Reply

I think that a style sheet can be added. And it worked!!--RaboKarbakian (talk) 06:29, 8 November 2021 (UTC) Except that it is breaking the paragraph up and the template promised not to do that.--RaboKarbakian (talk) 06:34, 8 November 2021 (UTC)Reply

missing image template edit

why doesn't this use Template:Missing image? it has the added feature of putting pages into Category:Pages with missing images (hi-res scan available).

I'd also request that this should allow passing Template:Raw image as an argument where appropriate, right now that returns an error. YuriNikolai (talk) 06:04, 21 October 2023 (UTC)Reply