The current API change that prevents returning images that are non-free was the easiest and most pragmatic solution to an immediate concern. However, this blanket solution prevents the community from creating or applying policy with nuance, because it mandates a specific policy across all use cases, projects, and 3rd party re-use clients. This is already an issue, as the english language community decided that non-free images were allowable on hovercards: https://en.wikipedia.org/wiki/Wikipedia_talk:Non-free_content/Archive_65#Hovercards
When we move hovercards to restbase (T123445), the image returned there will have to comply with relevant policy.
It is time to revisit this issue and apply a more flexible approach.
As an engineer implementing a feature that pulls images from Wikipedia or Commons, I require the ability to use either non-free images or only free images, as determined by my needs and how they correspond to community policy.
More specifically, the pageimages API should return images whose license is based upon a parameter (default free-only).
- The API should return free images for any requests that do not specify a free-ness/license parameter (IOW, backwards-compatibility)
- The API should return non-free images if specified by new parameter
- Specific testing should be done to ensure current requests to the API remain operational (though this should be satisfied by the first AC)
- Visit https://en.m.wikipedia.beta.wmflabs.org/wiki/Main_Page and search for "Star Wars vs Star Trek". Star Wars logo (free image) should be the image thumbnail.
- Search for "Star Trek test" and verify there is no page image. Do not click on the search result, rather observe that the image appears next to the search title in the search results.
- Search for "Star Wars test" and verify the star wars logo is shown alongside the title in the search results.
- Search for "Barack Obama" and verify you see his portrait alongside the title in the search results.
- Search for "Albert Einstein"and verify you see his portrait alongside the title in the search results.
- Visit https://en.wikipedia.beta.wmflabs.org/wiki/Special:ApiSandbox#action=query&format=json&prop=pageimages&titles=Star%20Trek%20test&pilicense=any and run query, which requests an image that can be free. Verify that alongside pageimage Star Trek is the logo not Star Wars.
- Visit https://en.wikipedia.beta.wmflabs.org/wiki/Special:ApiSandbox#action=query&format=json&prop=pageimages&titles=Star%20Trek%20test&pilicense=free and run the query. Verify that no page image is provided in the response