Dear Wikisource community,
I want to a ask a question that surely have been raised before.
Unfortunately, I haven't find that in the archive of wikisource-l,
so I will ask you.

On what legal basis are we uploading Google Books (and Internet Archive, and Gallica) scans on Commons, putting the {{PD-Scan}} on those?

I remember endless discussions in it.source about these issues, with contrasting opinions (both with reasons).
For example, if we are able to upload from Gallica to Commons and then Wikisource, why the WM-Fr community
did have to make an agreement with the BnF? Am I understanding this correctly? Was the material *donated*?
I know the texts are PD, but also the images?

I know this is a probably well known topic, I've just never read a definitive clarification on this issue.
Thank you

Aubrey