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 SVG support via resvg #40

Merged
merged 41 commits into from
Feb 10, 2023
Merged

Add SVG support via resvg #40

merged 41 commits into from
Feb 10, 2023

Conversation

RReverser
Copy link
Contributor

This is still missing text rendering because dealing with fonts is its own problem, but otherwise works well and is enough to pass Sharp tests.

Wanted to submit anyway so that my branch / work isn't lost, but leaving disabled by default because it's both incomplete w/o text, but also because it's a relatively rarely useful feature. More common problem is optimising SVG to SVG, for which people use tools like SVGO, while in libvips SVG can only be rasterised and treated like other raster images.

build.sh Outdated Show resolved Hide resolved
@d3lm
Copy link

d3lm commented Jan 16, 2023

Nice, still great to have this! Awesome work 👏

Dockerfile Outdated Show resolved Hide resolved
build.sh Outdated Show resolved Hide resolved
build.sh Outdated Show resolved Hide resolved
build.sh Outdated Show resolved Hide resolved
RReverser and others added 2 commits January 17, 2023 14:00
Co-authored-by: Kleis Auke Wolthuizen <github@kleisauke.nl>
@RReverser
Copy link
Contributor Author

Just a heads up - might be better to merge kleisauke/libvips#2 before this one to reduce complexity of patches in this PR.

@kleisauke kleisauke added this to the v0.0.5 milestone Jan 18, 2023
@kleisauke
Copy link
Owner

Commit 54bce44 fixes the remaining tests. I just opened PR libvips/libvips#3307 for that.

@kleisauke
Copy link
Owner

I'm planning to upstream the Rust patches introduced in commit 94e67b1

I just opened draft PR rust-lang/rust#107221 and rust-lang/libc#3087 for this.

@RReverser
Copy link
Contributor Author

I just opened draft PR rust-lang/rust#107221 and rust-lang/libc#3087 for this.

Nice! Out of curiosity, why do you create those PRs as drafts? They look like should be ready for review straight away?

@kleisauke
Copy link
Owner

Out of curiosity, why do you create those PRs as drafts? They look like should be ready for review straight away?

The Rust PR depends on the libc PR, so the libc crate needs to be updated first in Rust (i.e. a similar commit as rust-lang/rust@e294640 is needed).

The libc PR was marked as draft because it does not meet this check:

  • Edit corresponding file(s) under libc-test/semver when you add/remove item(s)

But perhaps I could add a new libc-test/semver/emscripten.txt file in that PR?

@RReverser
Copy link
Contributor Author

The libc PR was marked as draft because it does not meet this check:

I don't think that's necessary a criteria for draft, it just will be part of review comments? Idk, I just almost never use the draft PR feature so was curious about your usage / rationale.

@kleisauke
Copy link
Owner

I don't think that's necessary a criteria for draft, it just will be part of review comments?

Ah, sorry I misread your "review straight away" as "merge straight away".

I usually open pull requests as a draft if I think it's not ready to merge yet, these PRs can be reviewed but not merged as-is (because it is dependent on another PR or still being worked on).

Perhaps I should treat draft PRs as non-reviewable rather than non-mergeable? If so, the draft status of these PRs can be removed.

@RReverser
Copy link
Contributor Author

should treat draft PRs as non-reviewable

Ah that probably is our mismatch - that's how I understood them since they were introduced, yeah, sort of "work in progress, please don't review yet". After all, the button on the draft PRs is called "Ready for review".

@atjn
Copy link
Contributor

atjn commented Jan 27, 2023

From #40 (comment)

[this is] a relatively rarely useful feature

I just wanted to mention that I need this because I want to convert my website's icon into web app manifest icons. The website icon is SVG because that is the best format, but SVG is not supported on all platforms for the manifest, so I need to convert it to PNG.
I am very happy to see you beginning work on it - thanks!

@kleisauke
Copy link
Owner

I just opened draft PR rust-lang/rust#107221 and rust-lang/libc#3087 for this.

It seems that a release of libc with that PR included is taking longer than expected. I'll merge this as-is after the CI passes (the Rust nightly version is pinned, so I don't expect any build failures).

Copy link
Owner

@kleisauke kleisauke left a comment

Choose a reason for hiding this comment

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

Thank you! This will be in v0.0.5.

@kleisauke kleisauke merged commit 5f2af11 into kleisauke:master Feb 10, 2023
kleisauke added a commit that referenced this pull request Feb 10, 2023
@RReverser RReverser deleted the libresvg branch February 10, 2023 16:21
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.

4 participants