SDWebImageAVIFCoder icon indicating copy to clipboard operation
SDWebImageAVIFCoder copied to clipboard

Use rav1e for encoding using SPM

Open lucasfischer opened this issue 10 months ago • 4 comments

I know you clearly stated that using rav1e is currently not supported when using Swift Package Manager, but I was wondering if you have any ideas how to make it work with SPM. Is there anything I can do?

lucasfischer avatar Mar 02 '25 07:03 lucasfischer

Maybe need some binary framework support. Can you added some PR for this ?

dreampiggy avatar Mar 02 '25 14:03 dreampiggy

I guess this is not a simple binary framework issue, but the dependency resolve issue.

SPM

Because SPM does not support transitive dependency, which means:

You can not dynamic to use libavif-Foobar , when integrating SDWebImageAVIFCoder, while, use libavif-BizBuz, when not integrating SDWebImageAVIFCoder

This is the main problem, unlike CocoaPods.

CocoaPods

CocoaPods allows advanced dynamic resolve of dependency, means, you can integrate SDWebImageAVIFCoder with libavif/Foobar, or integrate SDWebImageAVIFCoder with libavif/Bizbuz, it's final controlled by user.

dreampiggy avatar Mar 03 '25 09:03 dreampiggy

A stupid workaround may be possible. We use something like dynamic check , instead of static macro check, to chooice actual codec to libavif.

But this need modify libavif's source code, which will makes Licences issue (maybe) ? I can have a try

dreampiggy avatar Mar 03 '25 09:03 dreampiggy

Why didn't you make rav1e the default? Licence issue?

lucasfischer avatar Mar 07 '25 01:03 lucasfischer