Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Feature Requests: Use from Safari, Flashlight

iPhone App
2010-10-07
2014-05-16
  • Ján Jockusch
    Ján Jockusch
    2010-10-07

    Hi spadix! Great program!

    The iPhone App can enable us to build some really cool web applications. There are only a few features missing in order to do that:

    1) Turn on the flashlight while trying to find a code with the camera. I am aware that this eats battery life, but it would improve the recognition speed and quality significantly. We tested it with a second iPhone illuminating the field. An option could enable the user to turn the flashlight off.

    2) Declare a new protocol for Safari, which may be called "zbar://". Other apps use this and it works beautifully. The URL could contain parameters (like flashlight on/off). This protocol would use the camera and, after having read a code, would return the symbology and content.

    3) Expose the F1-Separator in Code-128 (for instance as char 0x1d), so apps can decode EAN-128 (aka GS-1)

    I believe (…) that the features are relatively easy to implement, with the possible exception of number 2, but still I am aware that I'm asking a lot.

    I would be glad to help, but having neither a Mac OSX machine nor an iPhone SDK means I would be contributing untested, even uncompiled code, which might be more trouble than it's worth.

    Any feedback on this is greatly appreciated. Keep up the good work!

    - Ján

     
    • Derek054
      Derek054
      2014-05-16

      Thanks for the cool barcode reader

       
  • spadix
    spadix
    2010-10-09

    1. This is already supported in the SDK.  It should be available in the next version of the app…
    2. I never thought there would be a use for it with this app, but I guess you did say "web applications".  I will consider adding it to the ZBar app…  From a web app dev perspective, what's the easiest structured data format to grok results?  JSON?
    3. Yeah, that's been broken for a long time and really should be fixed… It would be great if you could open a bug report to track it!

    Thanks for the insightful feedback; very useful!

     
  • Ján Jockusch
    Ján Jockusch
    2010-10-11

    Hi spadix!

    Thanks for the quick reply! Concerning integration in a web application (item 2), JSON-formatted results would be great!

    I imagine a test application using an XMLHttpRequest (or jQuery, or else) to call zbar (with something like "zbar://<args>"), then using the result to dynamically update or perform other actions. This would make a great universal interface for all those silly shopping applications, but more importantly, it would enable serious barcode driven workflows.

    Concerning item 3: I just downloaded the Linux sources and will look into the Code128 section, perhaps I can come up with something… I'll open a bug report ASAP to track the results.

     
  • spadix
    spadix
    2010-10-11

    Getting a little confused here wrt web app integration, maybe you can elaborate on a few things:

    > after having read a code, would return the symbology and content.

    What is the proposed mechanism for returning to the invoking app?  The only reference I can find for returning to the caller is by having zbar invoking a return URL - not sure if that's going to be flexible enough, esp considering your mention of XMLHttpRequest…

    > Other apps use this and it works beautifully.

    Can you provide some examples?  A couple of open source examples would be great…

    > I imagine a test application using an XMLHttpRequest …

    I leave any test apps up to you  :)

    > … then using the result to dynamically update or perform other actions.

    AFAIK, there is no way to return data from a custom URL request to be used the way you describe…  Maybe you can fill in the pieces I'm missing?

     
  • Ján Jockusch
    Ján Jockusch
    2010-10-12

    Hi spadix!

    Thanks for researching this. I have no access to Apple's API documentation, so I simply don't know how this integration must or can be done. The only reference I have is an app called "redlaser" (a non-OSS competitor of yours who doesn't (yet?) integrate EAN-128), for which I've written a very simple example. (So I shouldn't have said "Apps", it's only one). This app uses URL transmission, as you describe, and opens a new page for each code transmitted. After a while, Safari decides it's better not to open any more pages, and each new code opens in Safari's last page. This works, but it is not the pinnacle of elegance, so I was glad when you suggested JSON, which sounded like there may be a better way of doing things.

    The code I use to invoke redlaser looks like this:

    <form action="redlaser://" method="get">
    <input type="hidden" name="return" value="http://my.scanner.application.com/path/to/method">
    <input type="hidden" name="param" value="q">    
    <button>Scan!</button>
    </form>
    

    Redlaser puts the scanned code behind the URL as parameter q, and calls Safari with that. So, it looks like you're missing no pieces at all. I just got a little over-euphoric at the sound of "JSON". But the iPhone APIs seem to be limited to what you've found out.

    Still, the method is worth implementing. Calling a custom URL from withing ZBar is one thing, but triggering the next scan from a web app allows a closed loop, which is nice.

    Thanks again for all your efforts, and for your patience with my not-100%-accurate statements!

    - Ján

     
  • spadix
    spadix
    2010-10-14

    > I was glad when you suggested JSON, which sounded like there may be a better way of doing things.

    Sorry about that, I was still trying to figure out what was going on…

    I also saw some other apps that are using the URL response hack…  I can look into adding something to the app.

     
  • Thanks for an excellent app!

    Relating to the current discussion, Picup is an app that permits you to:
    1. Click a link in mobile safari to launch the app.
    2. Choose a photo from the device or take a new photo with the camera.
    3. Upload the image via POST.
    4. Return control to the original safari window that began the sequence.

    Such functionality would be an excellent addition to Zbar.

    Watch the video and explore the API at  picupapp.com

    Thanks!

     
  • I'm just adding a vote for this feature. pic2shop has it, but the support for codes is very lacking. I _will_ switch to zbar when it gets this!

     
  • redlaser doesn't seem to work anymore - wrt opening safari with a URL that contains a parameter with the UPC value.

    It would be great if zbar would provide this functionality.

     
  • p2spro://configure?lookup=http%3A//www.upcdatabase.com/item/EAN
    Pic2shop PRO will replace the strings "EAN" or "UPC" with the barcode digits. (Unable to use it with barcode 128…)
    And RedLaser is not working anymore…
    Please Add that feature to zbar!!!

     
  • Is there any news about supporting the callback function like Pic2shop, or iCody
    Zbar://<function type>?<callback function call> I am using Filemaker Go.

    The scan tests I have made with Zbar, is working very fine, and the program is very quick to scan the barcode.
    Nice program!

     
  • ZXING has the feature similar to this, but it can only do QR codes on ios, but on android it can do all the codes.  On ios its
    zxing://scan/?ret=" URL TO SEND CODE TO HERE/?q=(CODE)".  they will sub in the actual decoded bar code for (CODE).  You can also add in any other parameters you want it to pass to the url.  I am not sure the best implementation, but here is how i have it setup, maybe you could improve on this.  When the user clicks a button, it triggers javascript to create a ajax connection to a node.js server and then opens a new window with the zxing url to scan the barcode.  The zxing sends the information to the url, which is the node server on a different port and this extracts the code and fires an event which sends it back to my original page and it puts the value in a textbox for the user.  The part i dont like is that it opens a new window.  Maybe in your design you could make it not open a webpage at all. just send the information "behind the scenes" to the url?  WOW, sorry that was so lengthy.

     
  • Tom Droz
    Tom Droz
    2012-02-20

    I am not seeing a recent responce to this discussion, I too am looking fro what 'Remy" (Pasted Below) said back in October 2010
    Any news on if this has happened or is in the works?  Tom

    2010-10-16 16:49:32 PDT
    Hi
    Because I'm using Filemaker Go apps. I want to be able to call Zbar with an URL to get the barcode and than send back with an URL to Filemaker Go. I have been able to do it with Pic2shop, but I would prefer Zbar to do it.

    Thank

    Rémy

     
  • Jeff Cooper
    Jeff Cooper
    2012-07-12

    I'm also using FM GO and would like to see a way to implement this.  If you could set up a custom URL similar to pic2shop or CNS Barode in  a future release, that would be great. Very nice reader; works quickly and accurately. Thanks.