Last modified: 2013-04-18 21:45:07 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T43174, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 41174 - Many SVG files without namespace (xmlns) attribute have stopped rendering
Many SVG files without namespace (xmlns) attribute have stopped rendering
Status: RESOLVED WONTFIX
Product: Wikimedia
Classification: Unclassified
SVG rendering (Other open bugs)
wmf-deployment
All All
: Normal major (vote)
: ---
Assigned To: Nobody - You can work on this!
: shell
Depends on:
Blocks: 41371
  Show dependency treegraph
 
Reported: 2012-10-18 14:55 UTC by Spinningspark
Modified: 2013-04-18 21:45 UTC (History)
14 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Spinningspark 2012-10-18 14:55:37 UTC
Some SVG files have become broken, according to http://commons.wikimedia.org/wiki/Commons:Village_pump#Software_update_leading_to_image_non-display due to a recent change enforcing <tt><nowiki>xmlns="http://www.w3.org/2000/svg"</nowiki></tt>
Comment 1 Sam Reed (reedy) 2012-10-18 15:14:23 UTC
http://upload.wikimedia.org/wikipedia/commons/archive/5/5c/20121018143017%21Electronic_linear_filters.svg views as XML, this isn't likely to be MediaWikis fault, it seems to be a browser related issue. More information would be very useful.
Comment 2 Nemo 2012-10-18 15:33:26 UTC
Previous version <https://upload.wikimedia.org/wikipedia/commons/archive/5/5c/20060426191653!Electronic_linear_filters.svg> views as XML too but MediaWiki renders it.
Comment 3 Andre Klapper 2012-10-18 16:35:21 UTC

*** This bug has been marked as a duplicate of bug 41113 ***
Comment 4 Spinningspark 2012-10-18 19:56:14 UTC
Reopening, unlikely duplicate - not just thumbnails that are the problem
Comment 5 Andre Klapper 2012-10-18 20:13:21 UTC
librsvg upgrade in https://gerrit.wikimedia.org/r/#/c/28495/ ?
CC'ing Tim.


(In reply to comment #0)
> http://commons.wikimedia.org/wiki/Commons:Village_pump#Software_update_leading_to_image_non-display

I've added {{tracked|41174}} to that entry (recommended way to do it).
Sorry for the wrong duping of this ticket.
Comment 6 Sam Reed (reedy) 2012-10-20 00:36:12 UTC
I'm still confused about this.

When serving originals e.g. https://upload.wikimedia.org/wikipedia/commons/archive/5/5c/20060426191653!Electronic_linear_filters.svg MediaWiki does absolutely nothing to it. MediaWiki doesn't modify previously uploaded files (or even uploaded ones, for that matter)


Also, we have no idea when this has actually been broken from. Which really doesn't help matters.

The recent change is the move to swift...

Testing locally, Imagemagick won't thumbnail it either, and also is served to me as XML
Comment 7 AnonMoos 2012-10-20 19:04:51 UTC
For a very simple case, look at http://commons.wikimedia.org/wiki/File:Urantia_three-concentric-blue-circles-on-white_symbol.svg

During 2009, 2010, 2011, and much of 2012, the simple 241 byte version of this file produced PNG thumbnails within librsvg / Wikimedia Commons.  At an unknown time in 2012 (but probably fairly recently), the PNG thumbnails stopped being produced, so that it became necessary to add the xmlns="http://www.w3.org/2000/svg" text within the enclosing SVG element.

If it can't be fixed, we'd at least like a list of files which need to be fixed due to lacking xmlns="http://www.w3.org/2000/svg" text...
Comment 8 Sam Reed (reedy) 2012-10-20 19:07:23 UTC
(In reply to comment #7)
> For a very simple case, look at
> http://commons.wikimedia.org/wiki/File:Urantia_three-concentric-blue-circles-on-white_symbol.svg
> 
> During 2009, 2010, 2011, and much of 2012, the simple 241 byte version of this
> file produced PNG thumbnails within librsvg / Wikimedia Commons.  At an unknown
> time in 2012 (but probably fairly recently), the PNG thumbnails stopped being
> produced, so that it became necessary to add the
> xmlns="http://www.w3.org/2000/svg" text within the enclosing SVG element.
> 
> If it can't be fixed, we'd at least like a list of files which need to be fixed
> due to lacking xmlns="http://www.w3.org/2000/svg" text...

And as I've said, repeatedly, visiting http://upload.wikimedia.org/wikipedia/commons/archive/6/61/20121018045628%21Urantia_three-concentric-blue-circles-on-white_symbol.svg directly, which is NOT a thumbnail, doesn't work either...
Comment 9 Jesús Martínez Novo (Ciencia Al Poder) 2012-10-20 19:56:41 UTC
Something must be common to rsvg, Firefox and Imagemagick, and it's probably the librsvg component. Firefox is updated every now and then, wikimedia servers updated librsvg on Comment 5, and probably the same for Reedy's test environment.

SVG files without the xmlns are bad-formed files according to the specification, so we can't do nothing about it except providing help to find what files are missing it.

Running find + grep on the filesystem where all Wikimedia Commons images reside would be a fast way to get all of them. If it's not possible, someone should query and download all svg images to check if they're missing the xmlns, or just test if the image isn't rendered at all.
Comment 10 AnonMoos 2012-10-20 21:52:31 UTC
Sam Reed wrote:
> AnonMoos wrote:
> > For a very simple case, look at
> > http://commons.wikimedia.org/wiki/File:Urantia_three-concentric-blue-circles-on-white_symbol.svg

> And as I've said, repeatedly, visiting
> http://upload.wikimedia.org/wikipedia/commons/archive/6/61/20121018045628%21Urantia_three-concentric-blue-circles-on-white_symbol.svg
> directly, which is NOT a thumbnail, doesn't work either...

What does that have to do with anything??

First, it's simply not true -- the file on that link won't display in FireFox, but it WILL in fact display in Inkscape or Adobe SVG plugin.

Second, regardless of whether it will display in Firefox, or is theoretically strictly 100% "correct" under some formal theoretical definition, it nevertheless remains true that such SVG files generated PNG thumbnails on Wikimedia Commons continuously from 2005 to some time relatively recently in 2012 -- and that's a problem (a bug, you might even say)...
Comment 11 AnonMoos 2012-10-21 16:18:53 UTC
P.S.  For the record -- the presence of xmlns="http://www.w3.org/2000/svg" is only mandatory in an SVG file if you take an XML-only point of view.  From the perspective of traditional SGML rules, other methods (such as including a <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"> header) were fully sufficient to identify an SVG file.  As far as I'm aware, Firefox has been consistent since around version 0.9 in refusing to display SVG files without an xmlns="http://www.w3.org/2000/svg" header, but Firefox does not define SVG correctness...
Comment 12 Bawolff (Brian Wolff) 2012-10-22 14:37:53 UTC
(In reply to comment #6)
> I'm still confused about this.
> 
> When serving originals e.g.
> https://upload.wikimedia.org/wikipedia/commons/archive/5/5c/20060426191653!Electronic_linear_filters.svg
> MediaWiki does absolutely nothing to it. MediaWiki doesn't modify previously
> uploaded files (or even uploaded ones, for that matter)
> 
> 
> Also, we have no idea when this has actually been broken from. Which really
> doesn't help matters.
> 
> The recent change is the move to swift...
> 

Presumably the move to swift just invalidated a whole whack of cached thumbnails that went back several years. I believe the change that made non-xmlns files fail to render goes back a couple years. (I think it was the change to SVGMetadataHandler that made it namespace aware. If mediawiki cannot determine width of image, it doesn't render it). Firefox only treats the image as an svg image if it has the proper xmlns
Comment 13 Derk-Jan Hartman 2012-10-22 17:06:05 UTC
I support Bawolff's view on this. Files without xmlns have not rendered for quite a few years already. So if we are seeing more reports now, then it's just the cache invalidation that threw out old thumbnails that had simply not been regenerated for ages.
Comment 14 Derk-Jan Hartman 2012-10-22 17:07:45 UTC
Safari doesn't render the file either btw, nor does Chrome. (just for the record)
Comment 15 Derk-Jan Hartman 2012-10-22 17:08:45 UTC
And we serve .svg with the "image/svg+xml" content type, so it's sort of logical in that sense that they don't.
Comment 16 AnonMoos 2012-10-22 19:05:06 UTC
Derk-Jan Hartman
> Files without xmlns have not rendered for quite a few years already.

Unfortunately, that's simply not the case; http://commons.wikimedia.org/wiki/File:POL_Opalenica_COA.svg was allowed to be uploaded without any xmlns="http://www.w3.org/2000/svg" as late as 12:59, 26 April 2011, and generated a thumbnail then (as it still does)...
Comment 17 AnonMoos 2012-10-22 19:09:16 UTC
Derk-Jan Hartman wrote:
> And we serve .svg with the "image/svg+xml" content type, so it's sort of
> logical in that sense that they don't.

I don't understand why we can't upload SVG files which are valid SGML files, since the W3C defines the SVG filetype with respect to SGML DTD's.  However, if we aren't to be allowed to have valid SGML files which are not also valid XML files on Wikimedia Commons, then we need some plan to deal with the files that were working when they were originally uploaded, but now no longer work, and I haven't seen one yet...
Comment 18 Jesús Martínez Novo (Ciencia Al Poder) 2012-10-22 19:33:56 UTC
(In reply to comment #17)
> I don't understand why we can't upload SVG files which are valid SGML files,
> since the W3C defines the SVG filetype with respect to SGML DTD's.

SVG needs the xmlns. SVG may use a DTD, but it's not required, and SVG are XML documents, and not necessarily SGML files. Please see this document that defines what a valid SVG file is: http://www.w3.org/TR/SVG/conform.html

  ...and the document fragment is determined to be valid as follows: (...)
   8. Set the attributes xmlns="http://www.w3.org/2000/svg" and
      xmlns:xlink="http://www.w3.org/1999/xlink" on D's document element
      and remove any other attributes in the Namespaces in XML namespace
      from D.

The fact is that every SVG file which doesn't have the xmlns declaration need to be fixed and reuploaded. But yes, some help as I suggest in Comment 9 would be much appreciated.
Comment 19 Andre Klapper 2012-10-22 19:57:40 UTC
(In reply to comment #18)
> The fact is that every SVG file which doesn't have the xmlns declaration need
> to be fixed and reuploaded.

(In reply to comment #9)
> Running find + grep on the filesystem where all Wikimedia Commons images reside
> would be a fast way to get all of them.

Adding "shell" keyword.
CC'ing Aaron.
Comment 20 Roan Kattouw 2012-10-25 06:51:19 UTC
(In reply to comment #18)
> The fact is that every SVG file which doesn't have the xmlns declaration need
> to be fixed and reuploaded. But yes, some help as I suggest in Comment 9 would
> be much appreciated.
That's only if we really cannot possibly render such SVGs, but comment 12 seems to suggest that this may be fixable. Let's not get ahead of ourselves here. Brian and/or Derk-Jan, could you elaborate on your comments and on how hard it would be to get a workaround in place for SVG files without an xmlns?

(In reply to comment #9)
> Running find + grep on the filesystem where all Wikimedia Commons images reside
> would be a fast way to get all of them.
find&grep on a 20-TB file repository isn't exactly fast. This is also complicated by the fact that the images now live in Swift rather than on a single file system. Tracking down all the affected SVG files is probably doable, but not trivial.

Aaron, could you weigh in on the practicality of finding all xmlns-less SVGs, and on whether that's even needed? If there's a way we can make these files play nice without having to track them down and reupload them, that would be nice.
Comment 21 Derk-Jan Hartman 2012-10-25 09:53:52 UTC
From my point of view, SVG files can only be hosted on the web if they are valid XML files. This is because there is only one valid Content-Type for these files, and that is "image/svg+xml". This declares that the 'downloaded file' is an XML file, which is also a requirement by by http://www.w3.org/TR/SVG/conform.html.

Files without xmlns are valid XML files. I think they are even well formed xml. Per the specification in G2 of the SVG conformance specification, they are however not valid SVG files because it specifies as a requirement for 'valid': "Set the attributes xmlns="http://www.w3.org/2000/svg" and xmlns:xlink="http://www.w3.org/1999/xlink" on D's document element", which these files do not have.

I note however, that for our parser, probably only xmlns is required, not xmlns:xlink...
Our parser also doesn't trip over files with missing DTD information and that is a requirement for valid SVG files.

This is all details. In theory we could have our parser retry the file without namespace information, if the root matches exactly <svg. However, considering the fact that neither Firefox, Chrome, Safari nor Mac OS X itself are able to display this file, I'm not sure if that is a good idea.

Are these files right now accepted for upload ?
Comment 22 AnonMoos 2012-10-25 12:24:56 UTC
Derk-Jan Hartman wrote:

> Files without xmlns are valid XML files. I think they are even well formed xml.
> Per the specification in G2 of the SVG conformance specification, they are
> however not valid SVG files because it specifies as a requirement for 'valid':
> "Set the attributes xmlns="http://www.w3.org/2000/svg"
> Our parser also doesn't trip over files with missing DTD information and that
> is a requirement for valid SVG files.

If xmlns="http://www.w3.org/2000/svg" is not actually formally required by either the XML or SGML standards, then what does it practically accomplish to be ultra-persnickety about it?  I'm with Roan Kattouw on this.  If you're implementing such a requirement for reasons of Firefox compatibility, then you should be clear about why you're doing it (and there would appear to be no imminently urgent reason to disable the PNG display of a significant number of SVG files right now in the service of an ultimate goal of Firefox compatibility).

P.S.  A number of programs require the xmlns:xlink="http://www.w3.org/1999/xlink" header for those SVG files which have links in the graphic code (not just in the metadata), but not for other SVG files...
Comment 23 Innocenti Maresin 2012-10-25 13:32:09 UTC
Actually, MediaWiki has little respect to Content-Type. It is dropped on upload, and generated from a file name suffix (extension) on download.
I do not advertise this approach, but an argument from Content-Type (which is next to ignored in MW) looks bizarre.
Comment 24 Derk-Jan Hartman 2012-10-25 13:45:25 UTC
(In reply to comment #23)
> Actually, MediaWiki has little respect to Content-Type. It is dropped on
> upload, and generated from a file name suffix (extension) on download.

In general MediaWiki doesn't rely on the suffix either. For the major filetypes that it supports it looks at the content to determine content-type. The suffix is only used for consistency with expectations of both humans and 'dumb' clients, because most of the rest of the world uses suffix and content-type with hardly any double checking.

For MediaWiki it matters what is INSIDE the file, not how that file is advertised. But as I stated earlier, it seems that XML files without xmlns are valid XML files, so i'm not so worried about the content-type issue anymore.

My main concern now is that these are not valid SVG files and what would be required for accepting non-valid files, without impacting functionality of other SVG files (or security).
Comment 25 Derk-Jan Hartman 2012-10-25 14:12:16 UTC
This might work:

https://gerrit.wikimedia.org/r/29968 but I will have to do a bit more verification to be sure.
Comment 26 Brion Vibber 2012-10-25 17:46:55 UTC
SVG files must include the SVG namespace per spec, and browsers don't render them without it. At some point we'll probably start pushing at least some SVG files directly to browsers, so we don't want broken files in the system that won't work.

If there are broken SVG files, we should make sure they get fixed.

I'm recommending against the patch in https://gerrit.wikimedia.org/r/29968
Comment 27 Derk-Jan Hartman 2013-04-18 21:45:07 UTC
I think we can close this as wontfix. It doesn't seem there are developers that think we should accept files like this.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links