Skip to content
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

Assertion failure in +[SVGKPointsAndPathsParser readCoordinate:intoFloat:] #445

Closed
sebasbad opened this issue May 13, 2016 · 4 comments
Closed

Comments

@sebasbad
Copy link

sebasbad commented May 13, 2016

  1. Installed pod:
    pod 'SVGKit', :git => 'https://github.com/SVGKit/SVGKit.git', :branch => '2.x'
  2. Loaded svg
let svgkImage = SVGKImage(named: "Ghostscript_Tiger")

let svgkFastImageView = SVGKFastImageView(SVGKImage: svgkImage)
svgkFastImageCanvasView.addSubview(svgkFastImageView)
resizeSubviewToFitSuperview(superview: svgkFastImageCanvasView, subview: svgkFastImageView)

let svgkLayeredImageView = SVGKLayeredImageView(SVGKImage: svgkImage)
svgkLayeredImageCanvasView.addSubview(svgkLayeredImageView)
resizeSubviewToFitSuperview(superview: svgkLayeredImageCanvasView, subview: svgkLayeredImageView)

The example project can be downloaded here: https://github.com/sebasbad/SVGKit-Swift-Demo/tree/feature/getting-started-with-SVGKit

The error is this

*** Assertion failure in +[SVGKPointsAndPathsParser readCoordinate:intoFloat:], /Users/XXX/ios/SVGKitSwiftTest/Pods/SVGKit/Source/Parsers/SVGKPointsAndPathsParser.m:322

The result is this: the SVGKFastImageView only shows part of the svg while the SVGKLayeredImageView doesn't show anything

captura de pantalla 2016-05-13 a las 13 59 41

The svg can be downloaded here: http://blackicemedia.com/presentations/2013-02-hires/img/awesome_tiger.svg

@adamgit
Copy link
Contributor

adamgit commented May 13, 2016

What's the error, what were the data values, what should they have been, etc?

On 13 May 2016 12:48:24 pm sebasbad notifications@github.com wrote:

  1. Installed pod:
    pod 'SVGKit', :git => 'https://github.com/SVGKit/SVGKit.git', :branch => '2.x'
  2. Loaded svg
    let svgkImage = SVGKImage(named: "Ghostscript_Tiger");

*** Assertion failure in +[SVGKPointsAndPathsParser
readCoordinate:intoFloat:],
/Users/XXX/ios/SVGKitSwiftTest/Pods/SVGKit/Source/Parsers/SVGKPointsAndPathsParser.m:322

The svg can be downloaded here:
http://blackicemedia.com/presentations/2013-02-hires/img/awesome_tiger.svg


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#445

@sebasbad
Copy link
Author

sebasbad commented May 13, 2016

Hi @adamgit , i've updated the issue comment. Do you need more info? Thnx

@adamgit
Copy link
Contributor

adamgit commented May 13, 2016

When Xcode has an assertion failure, it will show you data on the screen saying what it expected, and what actually happened. You have to read this - Xcode is very badly written and when you copy/paste the output, taht information is missing :(.

(old versions of Xcode didnt have this bug, but Apple broke it about 3-4 years ago and hasn't fixed it)

@aronkool
Copy link
Contributor

Today I also had this issue. It get caused because the parser does not parse the seperating comma's between values and than tries to parse something like ,1.43 and it's true that's not a valid float.

So I've made a fork and a pull-request to fix this issue: #519

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants