Skip to content
This repository has been archived by the owner on Aug 3, 2022. It is now read-only.

image tag with webp data not loaded #2

Open
tanphamanhh opened this issue Oct 7, 2019 · 3 comments
Open

image tag with webp data not loaded #2

tanphamanhh opened this issue Oct 7, 2019 · 3 comments

Comments

@tanphamanhh
Copy link

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

@dreampiggy
Copy link
Contributor

dreampiggy commented Oct 7, 2019

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.

@dreampiggy
Copy link
Contributor

dreampiggy commented Oct 7, 2019

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.

@dreampiggy
Copy link
Contributor

image

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.

@dreampiggy dreampiggy transferred this issue from SDWebImage/SDWebImageSVGCoder Nov 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants