restlessminded / dokuwiki-plugin-svgEmbed

A dokuwiki plugin that allows the use of the standard media syntax, but SVG files are placed with the <embed> tag, not the <img> tag.
GNU General Public License v2.0
1 stars 2 forks source link

SVG is microscopic! #5

Closed lizat closed 4 years ago

lizat commented 4 years ago

My link looks like this: {{:process_images:overviews:1000_tuvens.svg|Tuvens Overview}}

I have tried with a width as well, my config is left as default. And I have updated mime.local.conf. The svg is valid and displays in the browser from the local file: https://www.screencast.com/t/E0vkRSXg88P5

I am using Bootstrap3 template. I do have the image mapping plugin active.

What should I do?

restlessminded commented 4 years ago

Can you supply an .svg file that is exhibiting the issue in your setup? I'll see if I can recreate the issue on my side when I get an opportunity.

lizat commented 4 years ago

Try this... it is produced by Visio:

1000_Tuvens.zip

restlessminded commented 4 years ago

Definitely confirmed; I see what you mean when I added the file to my media and then linked it in a test page.

It happens in the Monobook template (what I use). I also have image mapping installed as it so happens, so let me see what I can figure out.

restlessminded commented 4 years ago

The good news is: I see the problem! The width attribute is in inches rather than pixels, so it's definitely a problem in my code; for that particular file it produces a 17x12 embed because the file is 16.5354 in x 11.6929 in; when I process the data it gets rounded off to the 17x12.

I need to consider how I want to approach this. Do I want to do a certain DPI? What about printing versus viewing (although to be fair, I only handle the xhtml renderer, so that may not be an issue)? Do I want to use the viewbox values instead?

restlessminded commented 4 years ago

Actually, the CSS3 specification specifies that styling should assume 96 DPI. I will implement around that, it seems reasonable. Also, I will likely only support absolute length units and not relative length units, but that won't affect your use case.

I'll try to work on it in the next couple days.

restlessminded commented 4 years ago

The issue is resolved and I have placed a new version of the software in the repository. You should be able to update your wiki from the Extension Manager and try out the changes. Please let me know if it resolves your issue!

restlessminded commented 4 years ago

Did you get an opportunity to see if this resolved the issue for you, @lizat?