SVG Image Format: Possible Integration Into PF Whiteboard?

  • Thread starter Thread starter SlowThinker
  • Start date Start date
AI Thread Summary
The discussion centers on the challenges of using PF Whiteboard for image creation on mobile devices, particularly due to the lack of Flash support and issues with JavaScript editors. Users express a desire for SVG image format integration, suggesting that SVG can be created in text editors and could simplify the drawing process. There are calls for adding SVG as a supported image format and enabling a feature to create new files from edit boxes, especially for mobile users. Concerns about potential security issues with allowing SVG and HTML tags are acknowledged, as implementing such features would require significant development work. Overall, the integration of SVG could enhance image posting capabilities on the platform.
SlowThinker
Messages
475
Reaction score
65
Hello.
I access the forums from iPad or Android, and it's really hard to draw images on them. The apps are less than awesome, and most online editors (including PF whiteboard) require Flash support, which is not available on mobile devices. Javascript online editors often don't work.
When they do, I draw something and try to download the image, I get things like

data:text/plain;charset=utf-8;base64,PHN2Zy...vc3ZnPg==

instead of the image, and it can't be used as URL in Upload.

So I came up with the idea that SVG images can be written in a text editor. Some online editors even allow you to draw and then copy the SVG as text. Would it be possible to
1) Add SVG as the supported image format?
2) Add to Upload button a possibility to create a new file with contents of an edit box? This is a trivial task on a computer, but mobile devices are really limited in these things.
3) Integrate SVG into the post, such as
[SVG="400,300"]
<path d="M0 0 q 150 50 300 0" stroke="black" fill="none"/>
<path d="M0 250 q 150 50 300 0" stroke="black" fill="none"/>
[/SVG]
or similar? I see there is a chance for the SVG to be malformed, so you can't just plug it into the text, but it would be nice if possible.
 
Physics news on Phys.org
I can investigate more, but until then, just how many people know SVG code and would use it?
 
Greg Bernhardt said:
I can investigate more, but until then, just how many people know SVG code and would use it?
If you ask me, I can only say that it's much simpler than LaTeX.
Finding a good online SVG editor seems hard, but this is not really a choice between good and bad pictures, it's between being able or unable to post pictures at all.
What are people using to draw pictures like this one? Is there some favorite scientific picture editor?

rindler-observer-measuring-c-png.90028.png
 
SlowThinker said:
If you ask me, I can only say that it's much simpler than LaTeX.
Finding a good online SVG editor seems hard, but this is not really a choice between good and bad pictures, it's between being able or unable to post pictures at all.
What are people using to draw pictures like this one? Is there some favorite scientific picture editor?

rindler-observer-measuring-c-png.90028.png
I drew this with Inkscape* -- a free SVG editor! -- and exported as a PNG bitmap. With SVG support I could have uploaded the SVG file itself. Note, however, that the SVG file was 554 KB whereas the PNG was only 48 KB.

In the past not all browsers had native support for SVG, but that may have changed.*Well, actually MATLAB drew the pink gridlines for me, and with an SVG add-on exported an SVG file that I then tweaked with Inkscape.
 
DrGreg said:
Note, however, that the SVG file was 554 KB whereas the PNG was only 48 KB.

Some simple SVG files might be smaller than their png rasterizations. One feature that would be worth exploring is an interactive SVG file.
 
I believe that simply enabling .SVG as the extension for uploaded images wouldn't hurt anyone. SVG is not that new, pretty much all browsers support it well.
I see that adding a textbox to the upload dialog would leave some people scratching their heads; OTOH the members of this forum are probably educated enough to understand its purpose.
Clearly, implementing the [SVG] tag is a lot of work for just a few people, I can understand that.

Do the ##\LaTeX## pictures still work? I tried it but couldn't make any image.
 
SlowThinker said:
Do the ##\LaTeX## pictures still work? I tried it but couldn't make any image.
Nope. MathJax doesn't seem to support the picture environment.
 
This isn't simple because we'd essentially be allowing for members to post arbitrary HTML and SVG can also embed javascript. You can imagine the security issues. To allow only SVG tags would require substantial custom work.
 
  • Like
Likes mheslep and dlgoff

Similar threads

Replies
0
Views
5K
Replies
0
Views
22K
Replies
0
Views
17K
Replies
1
Views
25K
Replies
0
Views
21K
Replies
1
Views
28K
Replies
2
Views
69K
Replies
2
Views
4K
Replies
1
Views
3K
Back
Top