3 ms·
JavaScript in a browser doesn't give you enough low-level access to manipulate images. A good compromise is to build the UI in javascript, and have the image pr
by waleedka 19y ago
JavaScript in a browser doesn't give you enough low-level access to manipulate images. A good compromise is to build the UI in javascript, and have the image processing on the server. Then, use AJAX to give the user a nice and quick experience that feels as if the processing is happening on the client. Of course, you won't have as dynamic a behavior as if it's all on the client, but that's probably the closest you can get with JavaScript. Other options include using a JavaApplet that runs on the client, or a .NET component (IE on Win only).
- ivankirigin 19y agoRight, I've been told a number of times now that I can't get access to the image buffer in JavaScript. That's too bad. I don't believe it can be made asynchronous and real-time. I suppose JavaScript could be used to control which resize scheme is used. While the bounds are changing, just scale and warp the image as a browser would today to make it fit a size. Once it stops changing, do an asych call to get a resized version of the image, with whatever fancy resize is needed. I'd like to avoid .NET and Applets. Flash might be a reasonable solution.
- ratsbane 19y agoI think you're right. I think the options for image processing on the client side are currently limited to VML ( http://en.wikipedia.org/wiki/Vml http://en.wikipedia.org/wiki/Vml ) for IE or for Safari/Firefox/Opera, SVG or Canvas ( http://en.wikipedia.org/wiki/Canvas_ http://en.wikipedia.org/wiki/Canvas_(HTML_element) ) and from the little bit of tinkering I've done with both, I don't think you can read the values of pixels of image buffers with any of those options. If anyone can disprove this I'd be very glad to hear it. You can with Flash or Java applets but both of those ideas have other problems as well. It certainly would be useful if it were possible. I've also been trying to figure out how to control a scanner from in the browser. I'd like to have something on a page which would scan a document, display the image in the browser, and upload it to a server. I was hoping I could do it with Flash, because Flash does have a TWAIN interface, but I've not been able to get Flash to recognize scanner devices, only cameras. I'm starting to think applets may be the answer to that, but that seems like a long road to start on. Does anyone have any ideas about controlling scanners within browsers?