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

Will not display image at the first time init a SVGKImage #814

Open
pikacode opened this issue Jan 19, 2024 · 5 comments
Open

Will not display image at the first time init a SVGKImage #814

pikacode opened this issue Jan 19, 2024 · 5 comments

Comments

@pikacode
Copy link

I am using SVGKit+Kingfisher, and this is my code:
image

v1 display nothing but a frame:
image

v2 display the right image:
image

so I have to do this to fix:
image

@adamgit
Copy link
Contributor

adamgit commented Jan 19, 2024

That's strange. What's in the first image? You had no console errors? Is it loading an external resource and fails/gets rejected first time?

@pikacode
Copy link
Author

I am using a simulator (iPhone 15, iOS 17.2), only got one console error:

*** Assertion failure in +[SVGLength pixelsPerInchForCurrentDevice], SVGLength.m:238

v1 and v2 is using the same data, this is just a single execution result, not multiple times. And only the first time init a SVGImage after app launched will got this issue. Maybe "something" did not initial immediately in SVGKit?

@szaboagoston
Copy link

I am using a simulator (iPhone 15, iOS 17.2), only got one console error:

*** Assertion failure in +[SVGLength pixelsPerInchForCurrentDevice], SVGLength.m:238

v1 and v2 is using the same data, this is just a single execution result, not multiple times. And only the first time init a SVGImage after app launched will got this issue. Maybe "something" did not initial immediately in SVGKit?

I have the exact same issue.

@adamgit
Copy link
Contributor

adamgit commented Apr 11, 2024 via email

@szaboagoston
Copy link

There was a recent patch to improve that code, something wrong with that commit?

On Thu, 11 Apr 2024 at 10:49, szaboagoston @.> wrote: I am using a simulator (iPhone 15, iOS 17.2), only got one console error: *** Assertion failure in +[SVGLength pixelsPerInchForCurrentDevice], SVGLength.m:238 v1 and v2 is using the same data, this is just a single execution result, not multiple times. And only the first time init a SVGImage after app launched will got this issue. Maybe "something" did not initial immediately in SVGKit? I have the exact same issue. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.>

No, I think that code is the solution. If I choose "3.x" branch in SPM, everything works fine as I see now. My fault was that I used the "Up to next Major Version" and that was 3.0.0 which was released in 2021. Sorry for this and thank you for solving the problem!
Btw, could you make a new release from the 3.x branch (e.g. 3.0.1)?

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