Error on basic execution of example code with simple svg file
Closed this issue · 3 comments
apptessence commented
Steps to reproduce the issue
- added a simple .svg to a new project with pocketSVG installed
- added code in readme page to viewDidLoad(), referencing that file instead of tiger.svg
- ran code in simulator
This is the error: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: [str hasPrefix:@"#"]'
EDIT: the code dies on the @main line of the standard, generated appDelegate.
This is the content of the file:
<?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">
<svg width="100%" height="100%" viewBox="0 0 1920 1080" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;">
<path d="M879.668,343.859C881.66,337.163 867.647,356.63 864.672,361.103C854.315,376.672 846.741,393.832 836.833,409.674C811.981,449.406 754.211,502.711 757.816,554.839C758.373,562.883 763.897,565.859 771.57,566.693C795.01,569.241 821.163,556.32 844.619,553.839C865.086,551.675 885.962,558.126 906.2,555.302" style="fill:none;stroke:black;stroke-width:35px;"/>
<path d="M913.003,363.677C954.434,334.165 1010,322.303 1025.32,384.522" style="fill:none;stroke:black;stroke-width:35px;"/>
<path d="M939.13,434.666C942.067,429.806 945.537,423.848 950.609,420.818" style="fill:none;stroke:black;stroke-width:35px;"/>
<path d="M825.351,390.823C824.921,369.933 794.446,356.744 776.767,359.859" style="fill:none;stroke:black;stroke-width:35px;"/>
<path d="M729.408,374.136C742.803,390.193 751.552,404.795 759.012,424.206" style="fill:none;stroke:black;stroke-width:35px;"/>
<path d="M805.524,614.046C805.806,621.578 802.182,633.45 805.379,640.324C818.508,668.555 885.417,663.522 909.928,657.369" style="fill:none;stroke:black;stroke-width:35px;"/>
<path d="M815.976,703.81C847.894,727.847 819.026,776.033 854.482,799.712C924.809,846.679 1126.28,802.409 1172.88,732.221C1192.54,702.609 1196.74,617.54 1208.14,603.976C1219.51,590.438 1248.89,592.818 1264.18,585.715C1311.66,563.649 1330.96,523.913 1335.88,473.913C1341.92,412.373 1303.78,324.434 1229.98,329.374C1220.18,330.03 1205.46,331.475 1198.54,339.447" style="fill:none;stroke:black;stroke-width:35px;"/>
<path d="M749.226,329.25C774.387,240.408 817.861,160.714 900.337,114.731C975.944,72.577 1048.34,66.822 1129.55,93.049C1242.82,129.628 1290.04,185.694 1312.56,300.77" style="fill:none;stroke:black;stroke-width:35px;"/>
<path d="M1243.79,631.785C1262.04,666.808 1289.3,713.914 1292.64,754.209" style="fill:none;stroke:black;stroke-width:35px;"/>
<path d="M1297.03,764.348C1278.47,869.901 1198.27,945.066 1095.52,973.146C1060.91,982.604 998.331,990.96 969.648,960.87C952.647,943.035 960.129,883.25 951.335,857.564" style="fill:none;stroke:black;stroke-width:35px;"/>
</svg>
The same issue has been raised, but no solution: this is a test on a very simple drawing.
Specifications
- PocketSVG Version: 25268e3
- Xcode Version: Version 12.5.1 (12E507)
- iOS/macOS Version: 11.4 (on M1 mini)
fjolnir commented
There's no assertion like that in pocketsvg: https://github.com/pocketsvg/PocketSVG/search?q=hasPrefix%3A
Please add a backtrace
joshink commented
fjolnir commented
PocketSVG doesn't support named colors, you'll need to replace black
with #000
or rgb(0,0,0)
(Thanks Josh!)