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

Add image resolver API #102

Merged
merged 5 commits into from
May 17, 2022
Merged

Add image resolver API #102

merged 5 commits into from
May 17, 2022

Conversation

zimond
Copy link
Collaborator

@zimond zimond commented Apr 26, 2022

  • Add imagesToResolve() and resolveImage() APIs to load image URL.
    • This only works for xlink:href starting with http:// or https://.
    • Supports only png, jpeg and gif formats.
  • Added infer crate to get the MIME of the image URL.

Fixes #76

image

@vercel
Copy link

vercel bot commented Apr 26, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/yisibl/resvg-js/HxTmBN3tTvRFVn3HMGbBU34dXuzf
✅ Preview: https://resvg-js-git-imageresolver-yisibl.vercel.app

@zimond zimond force-pushed the image_resolver branch from dfee185 to 61b0cc2 Compare May 5, 2022 02:45
@vercel
Copy link

vercel bot commented May 5, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
resvg-js ✅ Ready (Inspect) Visit Preview May 16, 2022 at 6:11AM (UTC)

@yisibl
Copy link
Member

yisibl commented May 5, 2022

我们还需要 Wasm 的 binding。

@yisibl yisibl force-pushed the image_resolver branch 2 times, most recently from 2b2edee to 0a8328a Compare May 8, 2022 09:26
@@ -56,3 +57,7 @@ opt-level = 3
# Setting this to 1 may improve the performance of generated code, but may be slower to compile.
# https://doc.rust-lang.org/rustc/codegen-options/index.html#codegen-units
codegen-units = 1

[patch.crates-io]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

请增加一个注释,注明使用 fork 分支的原因。

src/lib.rs Outdated Show resolved Hide resolved
@yisibl yisibl merged commit abc7530 into main May 17, 2022
@yisibl yisibl deleted the image_resolver branch May 17, 2022 02:25
@lizyChy0329
Copy link

Why is this feature not showing in README.md?

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

Successfully merging this pull request may close these issues.

Cannot render <image> node. Both external and embedded image.
3 participants