Uploading an SVG that contains
<!-- Title: ABC Pages: 1 -->
fails with
Sorry, but we couldn’t determine the size of the image. Maybe your image is corrupted?
Changing title to
<!-- Title: AB Pages: 1 -->
works. Yes, just changing ABC
to AB
made the difference.
It appears the length of the title name in the comment is limited to just two characters. Maybe something else but this is the case that reproduces the error every time.
i.e.
If a user sees the error message:
Sorry, but we couldn’t determine the size of the image. Maybe your image is corrupted?
how is a user upon seeing the error message to know that one of the possible problems is that they should change the length of the title in the comment to two or less characters.
or another option is that
discourse should modify the security scanner/whistleblower to allow title comments of other lengths valid.
The following SVG have line ends of LF and not CR/LF
Failing SVG
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.38.0 (20140413.2041)
-->
<!-- Title: ABC Pages: 1 -->
<svg width="110pt" height="64pt"
viewBox="0.00 0.00 110.00 64.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 60)">
<title>Test</title>
<polygon fill="black" stroke="none" points="-4,4 -4,-60 106,-60 106,4 -4,4"/>
</g>
</svg>
Working SVG
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.38.0 (20140413.2041)
-->
<!-- Title: AB Pages: 1 -->
<svg width="110pt" height="64pt"
viewBox="0.00 0.00 110.00 64.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 60)">
<title>Test</title>
<polygon fill="black" stroke="none" points="-4,4 -4,-60 106,-60 106,4 -4,4"/>
</g>
</svg>