SVG Scaling

@mcdanlj
There is something odd going on with uploaded SVG scaling. In this thread:
https://forum.makerforums.info/t/k40-whisperer-not-detecting-lines/82505/4

TanneM273 uploaded an SVG file and the scale was ridiculously small.

When I uploaded a SVG file in response the SVG was small so I increased the scaling percentage (in the post) to 1000% to get it to a bigger size. The size did not increase linearly with the percentage entered. there seemed to be steps at which it jumped dramatically.

I’ve seen this before.

For some reason Discourse decided it should be 12x8 pixels.

![Front|12x8](upload://wffVySQ30j5UczxrY5nifKC0kEP.svg)

I changed that to

![Front|480x320](upload://wffVySQ30j5UczxrY5nifKC0kEP.svg)

and now you can see it.

I don’t know why discourse does that or how it comes up with pixel size for SVG, but when you post them you can see whatever numbers it chooses and add some zeros and/or multiply by something big.

2 Likes

Thanks, the physical size of the SVG is 12"x8" so Discourse might not recognize units in (some or all) SVG files.

2 Likes

I think I have successfully audited the entire site for this problem, using the database and filesystem access to look for instances. Except for one DM thread, I think that I have resolved all instances of this by editing posts.

I didn’t notice that the 8x11 pixel rendering was not a dust mote on my screen and previously just changed it to a download link. I fixed it now to have a reasonable size.

This one was so small that I think it didn’t render at all, because it was 2 x 3 pixels of mostly white.

2 Likes

Discourse has fixed this, and Maker Forums has been updated with the fix:

This does not retroactively change the resolution of previously-posted SVGs, but it should be fixed for all new uploads.

Thanks @Scorch for the insight into what the real problem was! I think it was key to the Discourse folks being able to find and fix this.

3 Likes