Page MenuHomePhabricator

Allow on-wiki editing of SVG images
Closed, ResolvedPublic

Description

Author: nichalp.wiki

Description:
I have suggestion: I wish we could have a feature to edit
SVG images "wikistyle", like we do for articles. It would
help graphic artists immensely instead of repeatedly
uploading images for minor changes. We could also clone XML
content and translate text by this method for non-en wikis.


Version: unspecified
Severity: enhancement

Details

Reference
bz5899

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:13 PM
bzimport set Reference to bz5899.
bzimport added a subscriber: Unknown Object (MLST).

I'm going to merge this into bug 5172.

  • This bug has been marked as a duplicate of 5172 ***

ayg wrote:

On Rob's orders (mostly), I'll change this into the centralized bug for
wikistyle SVG-editing. Presumably it would be relatively easy to add parameters
once that's implemented, or something, because Rob told me to merge those in too.

ayg wrote:

*** Bug 6452 has been marked as a duplicate of this bug. ***

ayg wrote:

*** Bug 5172 has been marked as a duplicate of this bug. ***

ayg wrote:

*** Bug 4702 has been marked as a duplicate of this bug. ***

marco wrote:

We could create a new namespace "SVG:" or similar and could solve the problem on
this way.

bkell wrote:

This is a good idea, but it should still be possible to upload SVG files. Most
people who upload SVGs are going to make them in an external application; they
aren't going to edit all the path control points and things by hand. Of course,
then you run into the problem where some carefully hand-crafted SVG exists,
including parameters and other things, which has been built up over several
months by wiki-style editing, and someone comes along and improves the image
somehow with an external application and wipes out all the little tweaks that
have been made. Doing a diff to fix this problem would really be a pain, but I
can't think of a better way to do it.

Inserting parameters into an SVG file is also a tricky point, since SVG is an
XML application. If the parameters aren't done right, they could easily break
the validity of the XML. This would make it much more difficult to edit the SVG
file in an external application. Moreover, even if parameters are done in some
way that preserves XML validity, getting third-party editors to recognize them
(or maybe even ignore them gracefully) might be difficult.

leon wrote:

Well, how's about an action=editsvg? This link could appear additionally on the
image description page.

ayg wrote:

SVG provides a standard mechanism for extensibility, using XML namespaces. See
http://www.w3.org/TR/SVG11/extend.html. This method would be the appropriate
one to use when storing SVGs on the server and possibly when allowing people to
download them, although of course not when serving them for actual display. All
conformant SVG clients are required to ignore elements and attributes from
namespaces they don't recognize.

Conformance of parameter values should obviously be checked; typically it should
be possible to just escape everything inputted, unless there's some reason
entire tags or attributes need to be inserted. If there is, that could perhaps
be dealt with by using different types of parameters for tag names, attribute
names, tag contents, and attribute contents. Alternatively, you could allow
arbitrary text insertion at the parameter point and just make sure to validate
it before sending it on (passing an error or the parameter defaults if it
doesn't validate). This is all something people more familiar with SVG than I
should have opinions on, but clearly there are some obvious ways to go about it.

There could be some warning saying something like:

This SVG image was handcrafted and has some wiki-parameters in it. Please edit

it only if you know what you are doing.

This comment could be put in a description as a template by a creator/editor of
the SVG file. Would be similar to the one that is put in some complicated templates.

It would be nice if we had a tool that grepped through an SVG for <text></text>
fields, and provided a text box for the editor to input a translation. Then the
user could save it under a different filename, like NorthAmericaMap-hebrew.svg.
The way I see it, there'd be action=editsvg? for raw editing of the SVG file,
and action=translatesvg? for translation, as per above.

ayg wrote:

*** Bug 7712 has been marked as a duplicate of this bug. ***

stephane.brunner wrote:

On this image I have as a problem with arrow they are really small, in Firefox
or in Inkscape the arrows will be really bigger !!!

Is it the same bug, is there a work around ?

  1. You should specify which is "this" image.
  2. It has nothing to do with this bug. Seems to be a problem on rendering SVGs

as PNGs, thus a rsvg bug.

stephane.brunner wrote:

Oups I forget it :
http://commons.wikimedia.org/wiki/Image:Compression_JPEG.svg

Effectively with rsvg-view I have the same problem :(

Then how to display arrows ?

This is an _enhancement_ to allow editing a SVG file, this not about rendering
errors or any such things.

stephane.brunner wrote:

Effectively but initially I post to Bug 5163, there where strange redirect !

Sorry

cyril.buttay wrote:

Just a quick comment, which might be completely useless: why not use pgf? It is a LaTeX extension used to generate drawings, which has a svg export feature. It is very well documented, relatively clear syntax (for a latex extension...), and uses LaTeX which already generates the equations...

an example (not really appealing maybe): http://commons.wikimedia.org/wiki/Image:Switches_domain.svg

Cyril

ayg wrote:

Does it have SVG import too? And lossless export (i.e., guaranteed round-tripping)? If it's LaTeX-based foremost, then I suspect not. In that case it may be nice for creating SVGs, but not editing existing ones.

  • Bug 14320 has been marked as a duplicate of this bug. ***

Comment from bug 15721: Nowadays we have many different Versions of the same SVG image only with different descriptions. To keep images consistent it wold be really cool to have only one image for all languages, that only rendered for the different project languages. SVG supports this:
http://www.w3.org/TR/SVG/i18n.html
http://www.w3.org/TR/SVG/struct.html#SystemLanguageAttribute

  • Bug 15721 has been marked as a duplicate of this bug. ***

Current dev trunk includes the SVGEdit extension, which uses the above linked svg-edit to provide on-web editing from the file: page of any uploaded SVG file. It could use some more UI polish (and an update from svg-edit dev work which will add IE9 compatibility), but it's there and it works.

anonmoos wrote:

Hope it will have associated "history" and "compare versions" features, or it could be quite cumbersome to use. Also, since this is actually an "uploading over previously-existing image version" function, and it could be a way for vandals to quickly and easily make images non-functional, I hope that there will be an option to restrict anonymous IPs and users registered for less than 4 days from using it...

What’s necessary in order to activate this extension? (If it is not stable, this bug should not be marked as fixed.) I do not need a GUI. But when it's your goal to make SVG more popular, it should be easier editable. Most Windows users have serious problems when they should edit or even open a SVG. Sometimes you just have to exchange a few letters.

In the meantime, a lot of browsers natively support SVG. So an instant-preview would be also a nice feature. Feel free to make new bugs or whatever you think is appropriate.

This has come up again at Commons recently - see https://commons.wikimedia.org/w/index.php?title=Commons:Help_desk&oldid=72593008#Modify_an_uploaded_SVG-file and https://commons.wikimedia.org/wiki/Commons:Village_pump#Editing_SVGs.27_text_as_wiki_pages

As mentioned above, this bug is either NOT fixed or we don't know how to use the fix....

(I don't know if I'm supposed to do this or not, but I'm marking this as "REOPENED" in the hopes that it'll get some dev eyes on it.)

An extension was created for this: https://www.mediawiki.org/wiki/Extension:SVGEdit

It's not deployed on Wikimedia sites which is why you can't use it on commons yet.

Cool. How would we go about requesting that it be deployed?

As a better thought - is it deployed on a test wiki or something where we could see how it works?

achim wrote:

Sorry, this is a misunderstanding -- or better maybe Philosopher wanted a different thing than me, who triggered this reopen of this bug. Please see the link
[http://commons.wikimedia.org/wiki/Commons:Village_pump#Maintaining_(and_thus_editing)_SVGs'_text_like_wiki_articles].

I did create an account here and wrote this comment, because of
[http://commons.wikimedia.org/wiki/User_talk:Rillke#regarding modifying SVG-arcticle in wikimedia]'s advice. ~~~~

(In reply to comment #27)

(I don't know if I'm supposed to do this or not, but I'm marking this as
"REOPENED" in the hopes that it'll get some dev eyes on it.)

You're not supposed to do this. :-)

I'm going to go ahead and file a separate bug now about getting the SVGEdit extension reviewed and deployed to Wikimedia wikis.

I'm re-closing this bug as resolved/fixed. Please leave it that way.

Bug 38271 is now filed ("Review and deploy SVGEdit extension to Wikimedia wikis"). For some further background information regarding my closure of this bug and the filing of bug 38271, please see this mailing list post: http://lists.wikimedia.org/pipermail/wikitech-l/2012-July/061683.html.

(In reply to comment #32)
Wasn't sure - userrights seem to be rather loose around here so it's not always clear what you are supposed to change and what you aren't. Especially for us "drive-by users" of bugzilla.

Thanks for filing the new bug, though!

(In reply to comment #27)

(I don't know if I'm supposed to do this or not, but I'm marking this as
"REOPENED" in the hopes that it'll get some dev eyes on it.)

You're not supposed to do this. :-)

I'm going to go ahead and file a separate bug now about getting the SVGEdit
extension reviewed and deployed to Wikimedia wikis.

I'm re-closing this bug as resolved/fixed. Please leave it that way.

Gilles raised the priority of this task from Medium to Unbreak Now!.Dec 4 2014, 10:11 AM
Gilles moved this task from Untriaged to Done on the Multimedia board.
Gilles lowered the priority of this task from Unbreak Now! to Medium.Dec 4 2014, 11:21 AM