SDWebImageSVGKitPlugin
SDWebImageSVGKitPlugin copied to clipboard
image tag with webp data not loaded
Can the UIImageView load the svg file has a Image tag is webp base64 data?
The example file is in embed file test2.svg.zip
Image tag is webp base64 data?
From the theory and practice, it can't. But you can display the PNG/JPEG Base64 string in SVG.
This is because of the SVGKit itself here, just call +[UIImage imageWithData:]. However, all Apple platforms native API, does not support WebP format.
SDWebImage have a WebP support by using our own decoding system and have a category + [UIImage sd_imageWithData:] to support it. However, since SVGKit does not use SDWebImage's API, and does not expose any method to support external customization, so that it can not render any WebP images, whatever it use Base64 or remote link reference.
Actually, you can fire a new issue for SVGKit their repo (Since I'm not any maintainer for that), hope they can get a delegate or API for developer to provide the image decoding method, which can solve this problem.
But in long term, I found that SVGKit repo is no longer actively maintained. I'd like to switch the SVG support for SDWebImage, by using something more expert support, like Adobe Company's new proposal of SVG-Native.
SVG-Native is a new W3C standard (in draft) for native App system to render SVG format. It's a sub-set of W3C standard SVG-1.1 Because SVG is Borned to use on Web, there are many many of implementation need the Web environment, such as x-link-ref (What's this means for Native App, actually ?), CSS3 support (again, why a Vector format need a standalone standard with 500+ pages describing layout attribute), scriptable support (Why your native app need to run a script on vector format ?).
SVG native is the long-term solution on mobile/Mac system I think, once Adobe Company make it the ISO standard, I'd like to drop the Web-based SVG 1.1 and use SVG-Native starndard library instead.

I'd agree with Adobe for their W3C draft. Because I don't think a native mobile library (don't use WebKit) can implements all of the valid original SVG 1.1 for Web standard. Including CSS3 (500 pages, remember), Script support (a JIT envrionment engine), etc.