Steps to replicate the issue (include links if applicable):
See also: T429616
https://commons.wikimedia.org/wiki/File:Population_density_of_Ireland_map.png
https://commons.wikimedia.org/wiki/File:Population_density_of_Ireland_map.svg
- 2008-07-16: Initial upload as PNG at Population_density_of_Ireland_map.png.
- 2009-10-17: SVG version uploaded over the same name.
- 2012-09-10: File moved from .png to .svg.
- 2021-11-05: Reverted to an earlier (PNG-content) revision; current revision's img_major_mime becomes image/png again.
- Sometime 2025: T28741 migration ran on Commons. file row created with file_type pointing to image/png — correctly reflecting the state at that moment.
- 2025-12-30: User Sreejithk2000 performs a history split: delete .svg, restore only the SVG-content revisions to .svg, restore PNG-content revisions to .png. After this:
- image.img_major_mime = 'image/svg+xml' for the .svg file
- file.file_type still references image/png — stale
- Rendering the file page invokes PNGHandler (because file.file_type resolves to PNG), which fails on SVG metadata that has no frameCount key.
What happens?:
Current revision of a file had the incorrect filetype, ,because it was restored and the file type was not updated. This broke the file.
What should have happened instead?:
The current revision (at the very least) should always have the correct filetype, even if it's historic filetype was broken.
Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):
Other information (browser name/version, screenshots, etc.):