When the TimedMediaHandler extension is installed, calls to File::canRender for audio and video results in a value of true. Without the extension installed this results in false. The documentation for File::canRender indicates that:
Currently, this checks if the file is an image format that can be converted to a format supported by all browsers (namely GIF, PNG and JPEG), or if it is an SVG image and SVG conversion is enabled.
Because audio and video are not strictly images, this documentation is wrong when the TimedMediaHandler extension is installed. Because of this, the MediaModeration extension should ignore content that could be rendered (as determined by File::canRender) but such a render doesn't produce a supported image that fully conveys the meaning of the file. For example, video should not be included because such a picture would only be a frame from it. Also, audio files should be ignored as no image could be made that indicates the content in a way understood by PhotoDNA.
Steps to replicate the issue
- Install TimedMediaHandler
- Upload a midi file to the wiki (example at https://commons.wikimedia.org/wiki/File:2_Star_Spangled_Banner.mid)
- Run the following SQL replacing YYYY with the image of the uploaded file name without the File: prefix, with the file extension and with spaces replaced with underscores:
SELECT img_sha1 FROM image WHERE img_name = 'YYYYY';
- Replacing YYYY with the value returned by the query above, run the following:
SELECT * FROM mediamoderation_scan WHERE mms_sha1 = 'YYYY';
What happens
A row is returned by the query in step 4
What should have happened instead?
No rows are returned by the query
Software version
MediaWiki 1.42.0-alpha (4752fa6) 16:02, 28 November 2023. MediaModeration 0.1.0 (c16d8b0) 15:55, 28 November 2023