Page MenuHomePhabricator

Add an image: exclude non-images
Closed, ResolvedPublic

Description

Problem

The "add an image" experience is currently designed only for images. It relies on showing image thumbnails to users, being able to show zoomed-in versions of images, and the language around the feature is all about "images". Therefore, our feature does not currently handle other file formats, like video and audio files, which break all three things in the previous sentence.

Solution

We should not allow the user to do image suggestions where the suggestion is not an image. On arriving at the suggestion, they should see the dialog that tells them no suggestions are available and brings them back to the suggested edits feed.

In the future, this could be part of the upstream image algorithm.

Event Timeline

kostajh triaged this task as Medium priority.Nov 25 2021, 4:23 PM
kostajh raised the priority of this task from Medium to High.

@MMiller_WMF could you point to some article which is returning video or audio files. I remember one task showing some OGG file recommendation but I can't find it now.

I think the easiest way to test it would be to use the SubpageImageRecommendationProvider with some random Ogg file of your choice.

The way Commons images are handled on Wikipedia vs. on a developer machine is very different (ForeignDBFile vs. ForeignApiFile) but I don't think our code is affected by those differences at all. You might need to install the CommonsMetadata extension locally, but I don't think it's strictly necessary.

Change 742707 had a related patch set uploaded (by Sergio Gimeno; author: Sergio Gimeno):

[mediawiki/extensions/GrowthExperiments@master] Add an image: allow only valid image media types

https://gerrit.wikimedia.org/r/742707

I think the easiest way to test it would be to use the SubpageImageRecommendationProvider with some random Ogg file of your choice.

It definitely has been. Thanks for this. I did some changes in the subpage providers to accept quality gates.

The way Commons images are handled on Wikipedia vs. on a developer machine is very different (ForeignDBFile vs. ForeignApiFile) but I don't think our code is affected by those differences at all. You might need to install the CommonsMetadata extension locally, but I don't think it's strictly necessary.

I think the call to $file->getMediaType() should behave transparently since it has for the other metadata values. It is mocked in the tests so I will definitely test again in beta.

Change 742707 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Add an image: allow only valid image media types

https://gerrit.wikimedia.org/r/742707