You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Discourse uses fastimage as an initial check on image sizes. Fastimage detects svg images that have the "height" or "width" attribute value less than "1" as zero pixels. That ignores the units specified with the attribute value. If it was less than "1px", zero could be a reasonable interpretation. However less than "1in" is considerably different. Especially when the "viewBox" value shows that 1 inch is actually 1000 units. The (current) associated discourse code is quoted here
None of those workarounds are helpful for a typical forum user (https://forum.fritzing.org/). The images are associated with an application, where dimensions have meaning beyond the display size. Typical users works with inkscape, without knowing anything about the raw svg xml. Or the image is out of a part file created by other users or application code. The units are typically inches, because the convention is 0.1 spacing for many things.
The text was updated successfully, but these errors were encountered:
Discourse uses fastimage as an initial check on image sizes. Fastimage detects svg images that have the "height" or "width" attribute value less than "1" as zero pixels. That ignores the units specified with the attribute value. If it was less than "1px", zero could be a reasonable interpretation. However less than "1in" is considerably different. Especially when the "viewBox" value shows that 1 inch is actually 1000 units. The (current) associated discourse code is quoted here
For the problem images, the size_not_found error is displayed, indicating
pixels == 0
.Here is a minimal failing example
github does support uploading svg files, so I renamed to append ".txt" to the name.
image1.svg.txt
Increasing the size and adjusting viewbox to maintain aspect ratio to
height="1in" viewBox="0 0 1200 1000"
works.image2.svg.txt
Doubling the height and width to
width="2.4in" height="1.8in"
, then scaling back down in the post works.image3.svg.txt
Changing the
0.9in
height to the equivalent22.86mm
works.image4.svg.txt
None of those workarounds are helpful for a typical forum user (https://forum.fritzing.org/). The images are associated with an application, where dimensions have meaning beyond the display size. Typical users works with inkscape, without knowing anything about the raw svg xml. Or the image is out of a part file created by other users or application code. The units are typically inches, because the convention is 0.1 spacing for many things.
The text was updated successfully, but these errors were encountered: