resvg icon indicating copy to clipboard operation
resvg copied to clipboard

Add support for decoding WebP images

Open notjosh opened this issue 10 months ago • 4 comments

Hiya 👋

I was hoping to use WebP in a project, and noticed (via #575) that the image-webp project has been published now. This PR adds support for the project within resvg.

As noted in #575 there may be performance issues - I haven't tested extensively. However in my use case, it saves a step of converting .webp images to a compatible format, so even a slow(ish) implementation is an overall positive. With that in mind, it feels like a step forward for resvg to support WebP, even if there's still room in future for their (pre-1.0) project to improve.

notjosh avatar Apr 21 '24 11:04 notjosh

Looks good to me. All we have to do now is to ask them nicely to stop using thiserror.

RazrFalcon avatar Apr 21 '24 13:04 RazrFalcon

https://github.com/image-rs/image-webp/issues/66

RazrFalcon avatar Apr 21 '24 13:04 RazrFalcon

Looks like we need a MSRV bump as well.

RazrFalcon avatar Apr 21 '24 13:04 RazrFalcon

Ok, waiting for 0.1.3 and I'm ready to merge.

RazrFalcon avatar Apr 22 '24 07:04 RazrFalcon

any updates on this? would be great to have webp support ❤️

adamJLev avatar Jul 11 '24 18:07 adamJLev

Still waiting for the new release I think.

LaurenzV avatar Jul 11 '24 18:07 LaurenzV

0.1.3 was just released, so I'll rebase & clean up the PR soon....ish. I've got some family in town so it might be a couple of days.

notjosh avatar Jul 17 '24 18:07 notjosh

Sure, no problem.

RazrFalcon avatar Jul 18 '24 07:07 RazrFalcon

Okie doke, tests are green locally, so this should now be ready to review.

notjosh avatar Jul 22 '24 08:07 notjosh

error: package image-webp v0.1.3 cannot be built because it requires rustc 1.67.1 or newer, while the currently active rustc version is 1.65.0

How much of a dealbreaker is this? And/or as image-webp is an optional dependency, anyone that doesn't want to opt into the feature can continue to use < 1.67.1 version, I guess?

notjosh avatar Jul 22 '24 17:07 notjosh

We can bump MSRV no problem. It's set in:

  • .github/workflows/main.yml
  • README.md

RazrFalcon avatar Jul 22 '24 17:07 RazrFalcon

@RazrFalcon bumped MSRV, can you approve workflow? tyty.

Also, do you want me to bump CHANGELOG.md within the PR, or do you author those (for consistency etc)?

notjosh avatar Jul 24 '24 09:07 notjosh

All good, thanks.

RazrFalcon avatar Jul 24 '24 17:07 RazrFalcon