In order to prevent downstream bugs such as T332757: Invalid file error for Add image - OFFICE is not valid mime type , we should restrict the type of suggested files to images only.
The ideal solution would be to look up relevant MIME types, although we currently don't have such information available in our data pipeline outputs.
An alternative are file extensions: instead of filtering SVG files to avoid logos/icons as in T331456: [S] Filter out all .svg files from section-level image suggestions, we should keep image files.
Pasting below the set of all file extensions found in a previous Section-Level-Image-Suggestions run, 2023-01-30 snapshot:
SVG, JPEG, JPg, Svg, Jpg, PNG, Jpeg, Gif, JpG, pdf, djvu, JPeG, GIF, xcf, png, Tif, gif, jPeG, jpeg, JPG, Png, svg, tif, webp, BMP, stl, bmp, tiff, jPg, WebP, jpg, TIF, webm, JpEg, jPG, TIFF
Tasks
- revert T331456
- select a set of relevant file extensions. A starting point is jpg, jpeg, tiff, bmp
- keep those files through where conditions in both Image-Suggestions and Section-Level-Image-Suggestions