Thanks for the detailed response TRon. Regarding the files provided by AsleyCruz, I've just tested them with
virustotal.com and they appear to contain no virus and to be authenticated as provided by Microsoft. So we're alright concerning security.
About copyright, I don't think there is any issue here, this file being widely distributed. By the way, same applies to installing VC redist: in theory, one need to own a licence of Visual Studio to install it. The problem is, Visual Studio doesn't put the required Dlls near the the binaries that have just been compiled because it is expected to be on all target systems. So basically Microsoft considers the file to be kind of public.
Yes I compiled the webp dll for bgrabitmap so we're sure about the source of the files.
Thank you for that.

a simple look at the file in a hex-viewer is able to reveal the same information.
Doesn't sound that simple to look in the binaries. In fact there is new program that helps with that:
https://github.com/lucasg/DependenciesAccording to this program, the required Dlls are
vcruntime140.dll and
ucrtbase.dll.
Fun fact: the program Dependencies includes those Dll along its binaries.
I can't remember with wich version of Visual Studio I compiled the webp dll files, so that's a problem: knowing wich version of vcredist to download...
I guess from the name of library identified by AsleyCruz, it would be version 140. Note that you probably have those files on your system, since you compiled the library. And I found those Dlls on my system too. However, all things considered I don't think we need to provide them as such.
Asking for help to ChatGPT, it gave me a simpler solution. To statically link the runtime. This way, no need to provide additional Dll files. The little downsides is that the Dll will be bigger (about 150 Ko) and that the runtime won't updatable.
- For a library that decode WebP images, this is probably not a big deal that the runtime is not updatable independently, but it might be a problem if there is for some reason a major security flaw identified in the future
- 150 Ko is an increase of more than 100% of the size of the library, some people may prefer to keep it smaller
So probably the best course of action is to let developers decide if they want to provide the non statically linked or the statically linked Dll:
- for the developer, the statically linked Dll is the simpler option if they prioritize running the program on all Windows systems over real-time update of the VC redist framework.
- for the not statically linked Dll, it will run on most systems. The developper can invite the user to install VC redist, so they have the the framework and it will be updatable. The thing is how does we know when this is needed. Probably a better error message could be helpful, something like "The library requires Microsoft Visual C++ Redistribuable." and maybe provide a download link.
So I conclude that as far as BGRABitmap is concerned, the most balanced approach is to provide both the statically linked and the non statically linked, but not the VC redist files, and let the developers handle the versioning. What do you think?