Page MenuHomePhabricator

Images inserted by template doesn't show in hovercards
Closed, ResolvedPublic

Description

Images in my site inserted by using standart mediawiki templates. But hovercard (it use PageImages) doesn't show images.
I tried use basic image insert method, hovercard work perfectly.

Event Timeline

Antohabio raised the priority of this task from Medium to High.Feb 5 2017, 6:29 PM
Aklapper raised the priority of this task from High to Needs Triage.Feb 6 2017, 1:16 PM

@Antohabio: You increased the priority of this task. As priority reflects reality and does not cause it, why is this task more urgent than other tasks on the project workboard? Please do not change priority if it does not confirm with Setting Task Priorities. Resources of teams are limited when it comes to working on requests. We want to be realistic about communicating what is being worked on, to maximize the impact of changes. Practically, this often unfortunately means assigning a low priority to many tasks.

If the priority was increased because you plan to work on this task please claim the task by setting yourself as assignee. Thank you for your help!

@Antohabio what was the page you were editing, what was the template, what was the image that didn't work? Going to need all this information to dig deeper into this problem! Thanks in advance!

I have standard mediawiki template:

[[File:{{1}}]]

On page I define {{1}} parameter:

{TemplateName
|1=ImageName.png
}

I have image inserted to page by template, but PageImages extension in Hovercard extension don't show this image in hover card.
On page this image visibile normal.

Sorry for my english.

Hi @Antohabio thanks for the reply!
Is this a wikimedia site or a 3rd party instance? Is there a link i can use to see this problem? What license (if any) is the image of the file you use?

I tried testing this here and all seems to be working as expected:
https://en.wikipedia.beta.wmflabs.org/w/index.php?title=Test_popups_EasyImage_Template_T157162
You'll see a cup of tea when you hover over the link and when you click the link you'll see the image has been added by a similar template.

I am keen to understand, what's different about your setup.

For example, open page http://anthecology.org/a/6644444453. This page contain link to Arroyo_M.T.K.. Page Arroyo_M.T.K. contain image inserted by template.

On hovercard on 6644444453 page image from Arroyo_M.T.K. don't appear.

I found the cause of images nonappearance. Some of them were too small. Apparently, the extension eliminates the small images.

@Antohabio thank you for working out the cause.

Note you can edit wgPageImagesScores to include large images if you want. It's not very well documented but currently looks like this:

		"PageImagesScores": {
			"value": {
				"position": [
					8,
					6,
					4,
					3
				],
				"width": {
					"@doc119": "Very small images are usually from maintenace or stub templates",
					"119": -100,
					"400": 10,
					"@doc600@": "Larger images are panoramas, less suitable",
					"600": 5,
					"601": 0
				},
				"galleryImageWidth": {
					"99": -100,
					"100": 0
				},
				"ratio": {
					"3": -100,
					"5": 0,
					"20": 5,
					"30": 0,
					"31": -100
				}
			}

I think if you wanted you could tweak the negative scores to match your desires.
e.g.

$wgPageImagesScores['value']['width']['119'] = 10;

Is there anything else you would like help with or may I close this ticket as resolved?

Thank you for your proposed solution.
Thanks for the help, the ticket can be closed.

Jdlrobson claimed this task.

Thanks @Antohabio !
Let us know if you encounter any other problems!