Page MenuHomePhabricator

Support SVG titles in PNG thumbnails
Open, LowestPublic


Would it be feasible to add title tags to previews? (svg docs by Mozilla Contributors)

That is a tag, that gives a short-description to svg file elements. It can be seen on mouse hover on most browsers.
Example: (tags show when native svg file is opened)

This is additional information that can be useful for readers, but isn't available to them. It is really useful on maps and other files.

Note: I am talking about the first code variant, as the second isn't as widely supported.

<title>A file.</title>
<path title="A file.">

It would be great if this additional information within these files would be available to readers.

Event Timeline

Aklapper changed the task status from Open to Stalled.Apr 28 2020, 10:24 AM

Hi @Silraks, thanks for taking the time to report this! Unfortuantely I don't know what "title tags" are. Or where to see that when some SVG file is opened somewhere. Please add a more complete description to this task. That should be

  • a clear list of exact steps to reproduce the situation, step by step, so that nobody needs to guess or interpret how you performed each step,
  • what happens after performing these steps to reproduce,
  • what you expected to happen instead,
  • a full link to a web address where the issue can be seen.

You can edit the task description by clicking Edit Task. Ideally, a good description should allow any other person to follow these steps (without having to interpret steps) and see the same results. Problems that others can reproduce can get fixed faster. Thanks!

Silraks updated the task description. (Show Details)
Aklapper renamed this task from Adding svg titles to png previews to Support SVG titles in PNG thumbnails.Apr 28 2020, 1:34 PM
Aklapper changed the task status from Stalled to Open.
Aklapper edited projects, added Thumbor; removed MediaViewer.

Ah, thanks! I guess I was too impatient when I tried with the SVG.
Looking at the SVG source, this is done by defining a form via a path and its title:

<path id="pe" class="landxx yy" d="...">

I am aware of HTML's <area> within <map>, and usemap but I don't see how to convert titles in SVG paths to this, as the MediaViewer displays PNGs without some HTML overlay. Same applies to any PNG previews created by Thumbor, not specifically to MediaViewer which only picks an existing thumbnail image, hence removing the MediaViewer tag.

I currently do not see how this is feasible (apart from displaying the original SVG in a scaled form, instead of displaying a PNG thumbnail).

You could use something like, but that would mean extracting the geometry and titles from the SVG, rendering the SVG into a PNG, then re-applying the geometry and titles. That would require building something into MediaWiki, on top of the existing thumbnailing system, that is capable of parsing SVGs. That would add a lot of complexity for a "nice to have", and inline client-side SVG rendering (T208578/T5593) would be a better option.

AntiCompositeNumber moved this task from Backlog to Thumbnail quality on the Thumbor board.