Originally Posted by Arbitrator
Right, but it would be more intuitive to have some kind of readable error message and a restriction that prevents script execution.
One solution would to be to require a quoted string to input this character. Another would involve separating the arguments into separate form fields so that no character separator is required.
Apparently, this functionality does work... in most browsers. My mistake. I copied and pasted the existing line, but forgot to modify the position arguments; all of the text I was adding was overlapping the existing text.
I tested Chrome 27, Firefox 22, and IE10 and it worked fine. Not so much in Opera 15 (with the new Blink rendering engine) where it doesn't work at all.
I didn't know that. I guess I'll have to look into seeing if there's any way to eliminate it.
(I'm less familiar with the
element and tend to use SVG instead since I don't like the
element's rasterization. SVG might be better for this demo too actually. I wrote, for example, this demo
only to get ugly display artifacts when I was resizing the generated image and ended up throwing all of that code away and rewriting it for SVG to get the desired result.)
I'm on Windows 8.
I'd be more concerned about the errors and warnings in Firefox 22. When I run your code and leave the tab open for a short time while I browse other pages, it causes a substantial degrade in my browsing experience because the script is generating a bunch of errors (and maybe doing other non-erroneous things) that it shouldn't be doing when the page isn't even being used.
So I assumed, but I thought some suggestions might be helpful. I often code little projects like these and then come back to them repeatedly later to make improvements. It substantially improves my coding skills.
I've only been working on this for part of three or four days but I thought I would throw it out for other people who might want to work with it. If you go to my site and upload an image, use Firefox or Chrome to make sure, or test with IE, upload an image, then go to the 'Make an image inset' you will see how I'm using SVG for display purposes but on the server, where the actual work is done I use Imagemagick. It too has the annoying default behavior, but I wrote a workaround. The actual behavior is 0px = 2px, 1px = 1px, 2px = 2px, 3px = 4px, etc. very annoying.
I know that a lot of things need to be done to make this workable, but my problem is, how much time and effort do I want to spend on it when I have methods that will put 100 lines of text on an image flawlessly and easily, while it only does things one line at a time and you have trouble saving the files?
Using separate form fields would just destroy the intuitive and easy process that editing is now, better to just not use the field separator.