Some people upload fake SVG files, that contain nothing but a PNG. (Downloading them gives a file called ''index.png''.) It should be possible to rename these files, so they have the correct file extension. (It would make sense, to allow that only, when a file with the correct extension is uploaded in the same step.) See also Commons talk:Overwriting existing files.
Description
Event Timeline
I missunderstood @Watchduck , so I edited my answer:
"Downloading" sounds a bit missleading I think you meant "extracting them gives a *.png-file."
I opened the mentioned file (with admin-rights, because deleted svg)
and the svg looks like (removed line 5 to line 4485)
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1419px" height="1655px" viewBox="0 0 1419 1655" enable-background="new 0 0 1419 1655" xml:space="preserve"> <image id="image0" width="1419" height="1655" x="0" y="0" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABYsAAAZ3CAYAAAAhzirlAAAABGdBTUEAALGPC/xhBQAAACBjSFJN ... ... ... LTAyLTA4VDEwOjAxOjUxLTA3OjAwvo4UsQAAAABJRU5ErkJggg==" /> </svg>
PNG/JPEG can be extracted e.g using https://svgworkaroundbot.toolforge.org/#Extract_PNG_from_FakeSVG .
See my answer at Commons talk:Overwriting existing files.
The community has no interest to extract wrapped raster graphics into separate files. That makes sense, because duplicates are annoying.
My request is to make it possible to overwrite wrapper files with the extracted file.
I would decline this ticket. It asks for a mechanism that is not needed.
Fake SVG files are still SVG files.
Fake SVG files are displayed correctly. Do nothing, and everything still works.
Many, perhaps most, fake SVG files could have been uploaded with sensible vector elements that draw the image with text, lines, curves, and fills.
We could often be in the position of extracting the PNG from a fake SVG, uploading that PNG, and then tagging that PNG with the {{Convert to SVG}} template. Why not just leave such a fake SVG in place. The fake-SVG tag can be viewed as a request to vectorize the SVG.
https://commons.wikimedia.org/wiki/File:2020_Rat_HANT.svg is an example of a fake SVG that was subsequently vectorized. It is not longer a fake-SVG file; it no longer contains a bitmap image.
https://commons.wikimedia.org/wiki/File:Bandera_de_Enc%C3%ADo_(Burgos).svg is a fake SVG that could easily be vectorized.
Many files on Commons are little used. That they were not uploaded as the most obvious format has little impact.
Consequently, I oppose automatically converting fake SVG files to bitmap files.
When a fake SVG file should be converted to a bitmap format, then there is nothing wrong with the current practice of uploading a new file with a PNG or JPEG extension. Nobody need adjust the upload history or create redirects.
@Aklapper
As far as I understand @Watchduck on Commons: They want to extract the PNG and overwrite the SVG with the extracted PNG, so that in the file-history is a mixture of file-types. (not any more a svg).
Even if the explanation might be wrong, I think declining is the right thing to do.
I personally would like to ban Fake-SVGs, pure wraper-files with a single PNG, (Imho best to block upload), for the same reason, why PDFs are often out of scope, however it is controversial. (I don't want to discuss it here.)
If something should get changed, it should be first discussed&decided by "the Community" downstream (imho not at phabricator). I expect that a proposal will decide to keep things as they are.
extract the PNG and overwrite the SVG with the extracted PNG, so that in the file-history is a mixture of file-types
Yes. That is the first use case I described.
Concerning the controversy: @Glrx seems to think, that all fake SVGs are like this CoA.
I still think, that moving scans like these 1, 2, 3 or photos like these 1, 2, 3 to their correct file type, will be uncontroversial.
Where someone wants to create a vector graphic, and just started with a fake SVG, that can be communicated with a template.
Anyway, for now I will not create a proposal beyond this feature request.