Hi Eduard, On Apr 20, 5:43 am, Eduard Martini <[email protected]> wrote: > Nice article, but I do not understand few things. > > Why are you making those assumptions: > > 1. There is no way to pass captured image data from an applet to > the enclosing HTML page. > I am not using an applet for that, I am using desktop.openFiles to > add a file input element to the form. In this way user will be able to > simply "browse" and select the files (images) that he wants to upload.
I think you are comparing apples to oranges here. If you take a look at the screencast, you will see that the image is acquired by Gears application. The user clicks to capture an image from a DirectShow/ Twain device and .... BOOM, it's available in the application. The solution you're describing assumes that the image has been captured by some other program and saved somewhere, and then the user is going to upload it into the application. > > 2. Gears has very limited Blob support, so, critically, there is no > way to save Blob data into the private database. > Why I would want to save the blob in the database? I am using > captureBlob method from localStore. This will capture the blob on the > store and will be also available at given url in the offline mode. I > am only store the reference to the blob in store to know what I have > to upload to server when syncing the offline data with online. See my response to point 1. What you're saying is 100% correct, but you're describing the solution to a different problem. > > 3. If, somehow, issues one and two were both resolved, Gears does > not provide a way to set the source of an image to data stored in an > application variable (it may be possible to set a data src for an > image, but this would require base64 encoding binary data in the > browser, which seems out-of-reach with the current APIs). > I am using HttpRequest API and I set the params for request > store.getAsBlob(previously_stored_url) > > I am doing all that (storing user files in offline mode then sync them > with online DB) with only javascript and html code and about 20 lines > of code in total and is working in all browser and platforms where > gears is supported. Of course, since Gears supports the scenario you describe it's not too involved to get it working. I've used the approach you mentioned in the past, but in this case, the requirement was that the image capture take place seamlessly within the application. > > Hope that helps. Thanks for your feedback. > > Other way to do that is to attach captureFile method from localStore > to an input file element and then use fileSubmiter to put them in > online. This is deprecated and is only supported on IE and FF. > On Apr 20, 12:39 am, aahmad <[email protected]> wrote: > > > Hello, > > > In the course of developing Gears-based software for a client, I > > introduced some novel techniques for capturing data with Google Gears > > that I anticipate will be useful to others. I've documented these in > > an article and screencast on my website: > > >http://ahmadsoft.org/articles/gearpush/ > > > To Andrei and any others responsible for Gears, would you please > > consider adding this to the articles section of the developer > > website? > > > I'm looking forward to your feedback. > > > -amin
