New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parsing error missingAttribute(name: "offset") #9
Comments
Thanks again for the quick bug fix! I have understood the difficulty of supporting Thank you for your time despite your busyness. |
Wow, that's great! |
Now available in 0.10.1 |
Thanks for the great work! The PNG format output is correct, but the output Swift code draws strange images in the iOS simulator. The following error occurs in a very small percentage of SVGs. $ swiftdraw grapes_color.svg --format png
[swiftdraw] parsing error missingAttribute(name: "stop-color")
Failure Below are cases where there are still differences from the original. In some Emojis, paths for highlighting is clearly drawn. In some Emojis, some parts are not drawn. This is a rare case. I understand that perfect support for Microsoft's new Emoji set is not the goal of this library, but I hope this helps in some small way to improve this library. |
0.10.2 includes some fixes for some of these errors and includes ability to stroke a path with a linear gradient. The thin line artifacts appear because the One option is to hide these elements completely which improves some of the icons; But hiding these elements makes others look broken; I could offer a command line option to hide/show filters if that would help? |
Great work! Now high quality emojis display wonderfully on the iOS simulator. I think the command line option to hide elements where unsupported filters are used is a good idea. // like this...
$ swiftdraw snake_color.svg --format png
Created: /Users/***/***/snake_color.png
Warning: <feGaussianBlur> filter in this SVG file is not supported. You can hide these elements with [--blabla] option. The following is a small request not related to this issue. Just as The converted Swift code has two methods, // grapes.svg
extension UIImage {
static func svgGrapes(size: CGSize = CGSize(width: 32.0, height: 32.0)) -> UIImage {
// ...
}
private static func drawSVG(in ctx: CGContext, scale: CGSize) {
// ...
}
}
// snake.svg
extension UIImage {
static func svgSnake(size: CGSize = CGSize(width: 32.0, height: 32.0)) -> UIImage {
// ...
}
// Invalid redeclaration of 'drawSVG(in:scale:)'
private static func drawSVG(in ctx: CGContext, scale: CGSize) {
// ...
}
} |
There were still a few cases where some parts were not drawn. smiling_face_with_smiling_eyes_color.svg |
I must apologize for the serious mistake. The clay animation-like texture and realistic three-dimensionality of the emojis I used for comparison is not originally available in SVG. My deepest apologies for my silly mistake. |
Oh good to know. 0.11.0 includes support for stroking a path with radial gradients (fixes the latest issues). It also includes suggested changes for Also a new |
Many thanks for your work. |
It is uploaded now — was being notarized. |
The latest version works wonderfully. I feel very fortunate to have found your library through a web search. |
Microsoft has released a huge Emoji set as open source.
https://github.com/microsoft/fluentui-emoji
For each Emoji, three SVG files "Color", "Flat", and "High Contrast" and a PNG image "3D" are available.
SwiftDraw seems to fail to convert most SVGs of type "Color".
The error messages are all
parsing error missingAttribute(name: "offset")
.Try face_with_open_mouth_color.svg.
$ swiftdraw face_with_open_mouth_color.svg --format png --size 512x512 [swiftdraw] parsing error missingAttribute(name: "offset") Failure
The only "Flat" type that fails to convert is eleven_oclock_flat.svg.
$ swiftdraw eleven_oclock_flat.svg --format png --size 512x512 [swiftdraw] parsing error missingAttribute(name: "offset") Failure
In addition, a few of the "Color" types are successfully converted, but most of them are not converted correctly.
For example, the conversion of avocado_color.svg results in a black cross section.
(This may be a separate issue from the above.)
I'm not sure if you plan to support such complex SVGs, but I'm reporting this just in case.
The text was updated successfully, but these errors were encountered: