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

Wrong rendering of minified SVG files in iOS15 and below #49

Open
dhidalgofadrique opened this issue Oct 24, 2023 · 4 comments
Open

Wrong rendering of minified SVG files in iOS15 and below #49

dhidalgofadrique opened this issue Oct 24, 2023 · 4 comments

Comments

@dhidalgofadrique
Copy link

dhidalgofadrique commented Oct 24, 2023

I'm facing an issue rendering some SVG images which are minified in iOS15 and below, that is, some spaces are removed inside the path to reduce svg size. In those cases (minified ones) the image is rendered missing some paths. It can be checked using these two images:

Minified Normal
minifiedVersion normalVersion

As you can see the "+" is not rendered in the minified version:

NormalMinified

As far as I've could investigate the problem occurs in the arc paths (the ones starting with a) in which this format:

a.689.689 0 0 1 0 1.377

is replaced by this one:

a.689.689 0 010 1.377

Both images are shown correctly in any SVG viewer. Anyone facing this issue too?

Thanks!

@dreampiggy
Copy link
Collaborator

...Seems CoreSVG behavior differences ? Can you use the Adobe svg-native coder for testing as well ?

https://github.com/SDWebImage/SDWebImageSVGNativeCoder

@dhidalgofadrique
Copy link
Author

With this coder the image seems ok but we need the SVG version 😔 due to the image looses a lot of quality

Captura de pantalla 2023-10-25 a las 8 53 08

@dreampiggy
Copy link
Collaborator

@dhidalgofadrique SVGNative coder, does not preserve vector format actually. Because only the SPI which use CoreSVG can behave as vector (See readme)

For SVGNaive coder, however, you can, provide a context option .imageThumbnailPixelSize: CGSize(width: 1000, height: 1000)

Which draw a big enough bitmap version of SVG. So it still looks sharp.

@dreampiggy
Copy link
Collaborator

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

2 participants