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

WebImage not working with SVG #347

Open
mr-kew opened this issue Jan 28, 2025 · 1 comment
Open

WebImage not working with SVG #347

mr-kew opened this issue Jan 28, 2025 · 1 comment

Comments

@mr-kew
Copy link

mr-kew commented Jan 28, 2025

I did try to use the WebImage on SVG that found in example and it's displaying nothing.

Code:

let url = URL(string: "https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/wikimedia.svg")
WebImage(url: url) { image in
    image.resizable()
} placeholder: {
    Text("No image")
}
.indicator(.activity)
.scaledToFit()
.frame(size: .square(side: 300))

Log:

extractOptions:211: *** ERROR: unknown hint identifier 'kCGImageSourceTypeIdentifierHint:public.svg-image' -- ignoring...
createImageAtIndex:1964: *** ERROR: createImageAtIndex 1 could not find plugin for image source [273 bytes] 3C 73 76 67 20 78 6D 6C... '<svg xml'
createImageAtIndex:2093: *** ERROR: createImageAtIndex[0] - 'n/a ' - failed to create image [-62]
CGImageSourceCreateImageAtIndex:5100: *** ERROR: CGImageSourceCreateImageAtIndex[0] - 'n/a ' - failed to create image [-62]
@dreampiggy
Copy link
Collaborator

You hit the Apple ImageIO coder. Which is wrong. Check https://github.com/SDWebImage/SDWebImageSVGCoder readme again.

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