Proof of concept: use structured data regions #144
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Using Structured Data on Commons, users can define which subjects are depicted in an image, and which region of the image they reside in. (One way to define these regions is the Wikidata Image Positions tool, which despite its name also supports Commons.) We can use these regions as a basis for cropping – for example, if an editor has already marked where individual people are located in a group photo, the same data can be used to crop out images of those individuals.
I don’t think this is ready for merging yet, but I hope that you can help me improve it :) there are some TODOs in the source code to indicate what I think is missing. Not all of them are necessary to fix before merging, I think – the most important one is probably the user interface to select one of the depicted regions (instead of
prompt), which I hope will be easier for you than for me, since you’re more familiar with the UI framework used here.This is also fully implemented client-side, though I get the general impression that most of this tool is currently implemented server-side, with the client-side code talking to the server to do the heavy lifting. I hope that’s okay with you.
The code should be compatible with all MediaWiki-supported browsers (including IE11), though I’ve only tested it in Firefox 72 so far.