maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   mbarcode (https://talk.maemo.org/showthread.php?t=34996)

samualwalters 2010-06-29 18:01

Re: mbarcode
 
Quote:

Originally Posted by lardman (Post 727407)
Along the same lines, we should give the user the option of saving any barcode that cannot be decoded so they can send it in and we can look at the problem. Not sure how to do this - perhaps present a dialog after scanning for X seconds, or use a button to "Save Frame" during scanning. Will have to think about it.

Yes, that would be very useful! Even for non-barcoded items.

Some use cases:

* You've just tasted a very good wine or beer. But because you're liquored up, and you know you won't remember the label, and you can't be bothered to transcribe it into text or graffiti. So you take a snapshot of the label.

* Or you've just experienced a great restaurant, and they don't have business cards, or you just don't want to bother because their business card is the size of a flyer (yes, sometimes that's the case).. it would be useful to take a snapshot of the menu or oversized business card.

The NIT does not seem to have an app for snapshots. It's not surprising considering the poor quality of the ccd, but it's good enough for capturing drink labels.

This could go further, and the product images could be cataloged with product ratings.. eg, a tapable scale of 1 to 10.. perhaps notes as well.

Also useful, a Midgard plugin or the like, to transfer the product catalog to a desktop PC.

More needs:

* GPS tagging, so you can later recall where you saw or consumed the product.

* An onscreen 0-9 keypad to record the shelf price, in case you want to do price comparisons later.

samualwalters 2010-06-29 18:06

Re: mbarcode
 
Also, consider the earning potential. If you were to have a feature that gave users the option to anonymously upload barcode, gps location, and price to your centralized server, you would have quite a valuable database of shelf prices that don't tend to appear online.

You would have so much potential with this. Users could get instant feedback of not just online prices, but other local brick and mortar prices. And you could perhaps devote a part of the screen to ads that are similar to the scanned product (ad revenue could compensate mbarcode developers).

Tinnet 2010-06-30 12:11

Re: mbarcode
 
Would it be possible to use this in conjunction with google docs? Say spreadsheet?
I have like 5000-10000 units to register with serial number, company/internal serial number and model so it would be really nice to be able to automate this process!

dragly 2010-06-30 13:02

Re: mbarcode
 
Quote:

Originally Posted by Tinnet (Post 735336)
Would it be possible to use this in conjunction with google docs? Say spreadsheet?
I have like 5000-10000 units to register with serial number, company/internal serial number and model so it would be really nice to be able to automate this process!

This sounds like an interesting idea. Because the Google Docs API seems fairly easy to work with it should be possible to create a plugin for this purpose.

I guess it would be very generic, however, just adding a new record for each scanned barcode to a table of your choice (with the possibility to add some text as well).

lardman is also working on an itemdb plugin which I guess could be expanded to have some kind of CSV export functionality. I guess this would in the long term be a more neat solution to register large amounts of data.

I'll have a look at a Google Docs plugin if I get the time (no promises, though).

chemist 2010-06-30 13:08

Re: mbarcode
 
I noticed that the current testing version does not properly handle 2D QR-vcards, the new contact is just empty for me and the shown info in mbarcode is missing lines. The devel version does extract an 1D code from the same 2D QR-vcard, and each time I scan another code shows. Open jpg or png does not show an unable to open error in devel but it does not open it just like the testing version.

Tinnet 2010-06-30 13:09

Re: mbarcode
 
Cool!
Thanks for the info and I hope it's as easy as it seems (the google api that is) :)
Also if it works out i'll be forever greatful

Quote:

Originally Posted by dragly (Post 735373)
This sounds like an interesting idea. Because the Google Docs API seems fairly easy to work with it should be possible to create a plugin for this purpose.

I guess it would be very generic, however, just adding a new record for each scanned barcode to a table of your choice (with the possibility to add some text as well).

lardman is also working on an itemdb plugin which I guess could be expanded to have some kind of CSV export functionality. I guess this would in the long term be a more neat solution to register large amounts of data.

I'll have a look at a Google Docs plugin if I get the time (no promises, though).


dragly 2010-06-30 13:22

Re: mbarcode
 
Quote:

Originally Posted by chemist (Post 735380)
I noticed that the current testing version does not properly handle 2D QR-vcards, the new contact is just empty for me and the shown info in mbarcode is missing lines. The devel version does extract an 1D code from the same 2D QR-vcard, and each time I scan another code shows. Open jpg or png does not show an unable to open error in devel but it does not open it just like the testing version.

2D QR-vcards are not yet fully implemented nor working. What kind of QR code vcard are you testing (there are different standards out there).

Could you provide a link to the vcard you are having trouble scanning? Even though they are not yet usable, those vcards I scan are at least properly interpreted as 2D codes.

Open Image is also not yet implemented.

chemist 2010-06-30 13:56

Re: mbarcode
 
ok I don't know what happened! I took an 1D barcode and after that I got just a 1D number by scanning a 2D code... I just retested with newly generated codes to determine which error correction lvl I used and it worked... I cannot reproduce it by now tried several times to scan 1D first then 2D and the code is read properly anytime. (weird)

website for generator is

http://keremerkan.net/qr-code-and-2d-code-generator/

lardman 2010-07-01 09:06

Re: mbarcode
 
Looks like I need to check whether all the functionality of the GTK+ version got pulled across into the QR code decoder in the current version.

lardman 2010-07-01 09:22

Re: mbarcode
 
Hmm, ok so the vCard code is in the plugin but commented out. This is probably because we didn't get round to making the glib code work with Qt.

Does anyone know of any example code for manipulating the addressbook/contacts list using purely Qt? If so I'd prefer to move to that directly, otherwise I guess it's possible to pull in glib headers, I'll soon find out!

lardman 2010-07-01 09:30

Re: mbarcode
 
Ok I found out, pulling in the abook headers seems to drag in GTK+ headers and it all gets messy and unhappy. It may be possible, I don't know, but I'd still prefer to go Qt-only if possible.

lardman 2010-07-02 10:26

Re: mbarcode
 
Well I've changed the openGeneric() function to try to use the hildon_mime library (which I used to use successfully in the GTK+ version of mBarcode). Unfortunately it's not working, so I've either made a mistake (which now I think about it could be that I've not setup a DBus connection) or the lib has changed.

The DBus thing will also explain why vCard handling is still not working (I write to a temp file, then get hildon_mime to open the file using its mime handlers). I'll fix this later on today. Doh!

I also see that I told a lie about how the decoders are plumbed in, it looks like they still reside in separate threads rather than gst elements (now I think about it, using the gst element decoders was rather slow iirc).

Therefore it should be quite simple to work out/fix the fact that the saved frame is not necessarily the one that's decoded.

Onto other thoughts, I'm tempted to split up the monolithic qrcode plugin into separate plugins to handle different payload types, but not sure if it's worth it for simple and generic payloads (e.g. vcards, telephone #s, urls). The disadvantage is overhead from extra plugins, the advantage is that each barcode can be parsed and for e.g.a QR code containing a vcard, the vCard plugin could present itself, as well as a telephone number plugin, url plugin, etc.

That way you'd not need to save a vCard to be able to open a URL, dial a number on it, etc.

lardman 2010-07-02 13:35

Re: mbarcode
 
Just pushed an updated version of mBarcode (and the qrcode plugin) to extras-devel. Changes:

Remembers scanned barcode history list between restarts, menu button to clear all, menu settings checkbox to enable/disable whether to remember between restarts.

Menu settings numeric editor to alter the autofocus delay time.

Long push on the history items opens a popup menu from which you can save (the image) or delete an item.

Changed the backend so the image that is placed into the history list should be exactly the same one that was just decoded.

Added feature whereby tapping on the live video window will allow you to save the last image in the memory buffer (for e.g. allowing us to debug why a barcode won't scan).

QRcode plugin changes were in the backend to try to enable hildon mime opening of various filetypes, but this still doesn't seem to work (I'm working on it! If anyone has any ideas please pipe up - I have now created a dbus connection in the mainwindow class, so that shouldn't be the problem).

I think that's about it, just need to integrate pythonQT so we can have Python plugins, write a "plugin writing" howto, enable decoding from a file (Open file button) and then ui should be workable (though we'd still like to look at some transparency effects, etc.)

msa 2010-07-02 15:04

Re: mbarcode
 
sounds good.

i hope this will come to extras this year.

lardman 2010-07-02 15:08

Re: mbarcode
 
Well basically once the scan from a file button does something and the pythonQT support is in place and we work out what's wrong with the mime handling and fix that, I see no reason why it shouldn't go to Extras.

I'm ever hopeful we can get it done by the end of next week at the latest (otherwise it'll have to wait as I'm away for the best part of a month!)

joshn53 2010-07-04 03:35

Re: mbarcode
 
Just tried mbarcode out. Great work!

One thing: it looks like it's supposed to open the barcode URL if a QR code specifies one, but that didn't work for me.

Is there a way that others can get involved? I'd love to help with development, but I couldn't find a source code repository anywhere.

lardman 2010-07-04 09:14

Re: mbarcode
 
Quote:

Originally Posted by joshn53 (Post 740021)
Just tried mbarcode out. Great work!

Thanks! :)

Quote:

Originally Posted by joshn53 (Post 740021)
One thing: it looks like it's supposed to open the barcode URL if a QR code specifies one, but that didn't work for me.

Strange, I think the QRcode plugin should parse the file and if it doesn't find anything else before the http:// (e.g. a vCard header) then it will try to open the URL with the browser.

With that said, it may be that there's something else before the http:// and everything is getting passed to the uri_open function and confusing it. I was just looking at this yesterday and thinking that I ought to make sure the text is trimmed so that it starts at http:// to prevent this.

Quote:

Originally Posted by joshn53 (Post 740021)
Is there a way that others can get involved? I'd love to help with development, but I couldn't find a source code repository anywhere.

Of course, more help always welcome, check out the maemo-barcode Garage project, we're hosted on the Garage SVN server.


Onto my current dev thoughts, I was looking at how to hook up PythonQT yesterday, and while it looks doable, I doubt I'll get time to do this before I head off to the USA. So I was thinking it would be worth supporting external application plugins - i.e. like the existing plugin libraries (i.e. they present a button which you can click after a suitable barcode has been scanned), but using DBus calls to send the data to an external app (starting it up if necessary). I know people have been after this/interested in this for a while.

I was planning on having external apps place an 'ini' file in a subdir of the current /usr/share/mbarcode/plugins directory, and then these files will be parsed at startup to see which external applications which to be added as external plugins. Content would be something along the lines of "app name, dbus call, barcode types list". I'll try to take a crack at this this afternoon/evening.

Still need to write some HowTos for how to write internal plugins (and assuming I get it working, how to do the DBus stuff in your app to receive either the broadcast messages which mBarcode currently emits - since yesterday anyway, and specific external application plugin callbacks).

Also thinking quite hard about having the qrcode plugin provide multiple buttons if the barcode content contains more than one handleable payload (e.g. vCard and telephone and url and etc., rather than just the first one found).

Oh, and for some reason the hildonmime functions don't seem to be too happy opening things such as SMS: and vcards (*.vcf). I'm using the QDesktopServices::openUrl() function which wraps the hildonmime C functions, but it opens vCard files in the browser and ignores things like SMS. These used to work in the GTK+ version and at least opening *.vcf works in Hildon File Manager, so I need to work out why it's not working now.

joshn53 2010-07-04 21:37

Re: mbarcode
 
I looked into the QR code url issue. It turns out this is because the package doesn't include the libmarcode_qrplugin.so file in /usr/share/mbarcode/plugins. I presume this is simply an error in packaging?

Creamy Goodness 2010-07-04 22:12

Re: mbarcode
 
This is working pretty good for me, thanks. I noticed my newspaper is using some proprietary bar code system called EZ code / scanlife / scanbuy
I don't know. I looked it up briefly, they make an app for most phone OS and everything is "open" enough, except they maintain their private database of codes and whatever content it links to.
Anyways, it sounds pretty lame, but I thought I should mention it. These bar codes are pretty popular in Japan but not here.
-edit-
(bar codes in general are popular in japan, on posters and stuff i gather, i've never heard of ez code before)

lardman 2010-07-04 22:38

Re: mbarcode
 
Quote:

Originally Posted by joshn53 (Post 740664)
I looked into the QR code url issue. It turns out this is because the package doesn't include the libmarcode_qrplugin.so file in /usr/share/mbarcode/plugins. I presume this is simply an error in packaging?

Dunno actually - how did you install mBarcode? I think it should pull in the plugins automatically (they are in separate packages).

lardman 2010-07-04 22:42

Re: mbarcode
 
Quote:

Originally Posted by Creamy Goodness (Post 740682)
This is working pretty good for me, thanks. I noticed my newspaper is using some proprietary bar code system called EZ code / scanlife / scanbuy
I don't know. I looked it up briefly, they make an app for most phone OS and everything is "open" enough, except they maintain their private database of codes and whatever content it links to.
Anyways, it sounds pretty lame, but I thought I should mention it. These bar codes are pretty popular in Japan but not here.
-edit-
(bar codes in general are popular in japan, on posters and stuff i gather, i've never heard of ez code before)

Ezcode looks to be a different barcode encoding. As we only support what's offered in libzbar and libdmtx, if you'd like this supported you'll have to have a word with them (or submit patches, looks like Ezcode is designed to be quite simple, so you should be able to follow the pattern of the QR code decoder in libzbar and get something working reasonably quickly).

With that aside, if their db of codes and linked content is private, it makes it a bit awkward unless there's already a site which does the translation for us? If so, and there's enough interest, why not get it added as a decodable barcode type and we can sort out a plugin to handle the data it produces :)

joshn53 2010-07-04 22:46

Re: mbarcode
 
Quote:

Originally Posted by lardman (Post 740700)
Dunno actually - how did you install mBarcode? I think it should pull in the plugins automatically (they are in separate packages).

I installed mBarcode normally using the Application Manager.

joshn53 2010-07-04 22:59

Re: mbarcode
 
The plugins system is cool! To get the feel for it, I made a simple plugin to look up ISBN's on Amazon. Is this something Of General Interest?

Also, one code suggestion: it would seem cleaner to pass a QWidget* to initInterface, so each plugin doesn't need to know about mainwindow.h. I'd be happy to do this if you want to give me commit access.

lardman 2010-07-05 08:46

Re: mbarcode
 
Quote:

Originally Posted by joshn53 (Post 740715)
The plugins system is cool! To get the feel for it, I made a simple plugin to look up ISBN's on Amazon. Is this something Of General Interest?

Also, one code suggestion: it would seem cleaner to pass a QWidget* to initInterface, so each plugin doesn't need to know about mainwindow.h. I'd be happy to do this if you want to give me commit access.

Dragly? The plugin system implementation is his baby, so if he's happy I'm happy.

lardman 2010-07-05 08:48

Re: mbarcode
 
Quote:

Originally Posted by joshn53 (Post 740711)
I installed mBarcode normally using the Application Manager.

Can you check and see if mbarcode-plugins-qrcode is installed?

If it is, and the plugin's not in the right place, then perhaps we have a packaging issue somewhere. Thanks :)

joshn53 2010-07-05 13:21

Re: mbarcode
 
Quote:

Originally Posted by lardman (Post 741012)
Can you check and see if mbarcode-plugins-qrcode is installed?

If it is, and the plugin's not in the right place, then perhaps we have a packaging issue somewhere. Thanks :)

No, the package isn't installed. I didn't realize that it needed to be.

Wouldn't it make most sense to make the mbarcode package pull in the plugin packages?

lardman 2010-07-05 13:26

Re: mbarcode
 
It might make sense to make them recommended, but some people might not want all the plugins.

I'm not sure what the best way is here really, but certainly judging from your experience we should make it clearer at least.

Actually the 1D and QR (i.e. 2D, handles dmtx too) plugins should probably be installed by default anyway. We should also sort out the settings page to enable/disable different plugins, then installing them all would make no real difference.

lardman 2010-07-05 13:29

Re: mbarcode
 
I've just pushed some skeleton code for ExternalDBusPlugin to SVN, I'm planning on having this plugin parse ini files which are provided by external apps and then allow you to send barcode data to these specific apps via DBus if it matches the type and content wanted.

E.g. there is apparently a youtube:// barcode payload type, this could be sent directly to a dedicated YouTube viewing app; likewise there's a geo:// payload type that could be sent to one of the mapping apps.

Will try to finish this off this evening, and then also break the qrcode plugin up so that it can provide the multiple handlers for mixed content barcodes as I outlined earlier in the thread.

joshn53 2010-07-05 13:31

Re: mbarcode
 
Quote:

Originally Posted by lardman (Post 741231)
Actually the 1D and QR (i.e. 2D, handles dmtx too) plugins should probably be installed by default anyway. We should also sort out the settings page to enable/disable different plugins, then installing them all would make no real difference.

The settings page sounds like a good idea.

OK, my next question: :) For me, portrait mode doesn't work very will, since the barcode history takes up 75% of horizontal space. Is it working like this for everyone? If so, it would seem ideal to split the window vertically, and have the camera on the top half, and the barcode history on the bottom half. Does this sound reasonable? If so, I can see how much work it would be.

lardman 2010-07-05 14:20

Re: mbarcode
 
Quote:

Originally Posted by joshn53 (Post 741240)
The settings page sounds like a good idea.

OK, my next question: :) For me, portrait mode doesn't work very will, since the barcode history takes up 75% of horizontal space. Is it working like this for everyone? If so, it would seem ideal to split the window vertically, and have the camera on the top half, and the barcode history on the bottom half. Does this sound reasonable? If so, I can see how much work it would be.

Yes, that does sound reasonable. The portrait support is just how the main page rotates, and in no way designed to be that way on purpose.

Before you start expending time on this though, there was talk of moving to a UI more like that of maemo-mapper - i.e. something pretty and full screen (camera in this case) with buttons as overlays, and then the history/till-roll list could be a pull-out tab (in which case it may be better left as a vertical list, I don't know). Any thoughts in general (from everyone) on whether a prettier UI would be beneficial?

In any case, please do do some hacking if you feel like it, the more the merrier :)

*Sonic* 2010-07-05 21:53

Re: mbarcode
 
Not sure whether it is me being in the UK, but out of all the things Ive tried to scan, the only things ive had recognised is a couple of books

My brother has an iphone and his app recognises pretty much everything he scans in

I havent used the buddy option, only the external links

lardman 2010-07-05 22:34

Re: mbarcode
 
Quote:

Originally Posted by *Sonic* (Post 741686)
Not sure whether it is me being in the UK, but out of all the things Ive tried to scan, the only things ive had recognised is a couple of books

My brother has an iphone and his app recognises pretty much everything he scans in

I havent used the buddy option, only the external links

When you say recognised do you mean by e.g. the weblookup, or do you mean that no barcode (EAN number for example) is produced from the image?

If it's the latter then please send me some images, if it's the former, the yeah that may well be - we need more backend plugins to do lookups of decoded EANs :)

*Sonic* 2010-07-05 22:37

Re: mbarcode
 
Sorry I should have been clearer, the images captured produce the results required, ie the barcodes scanned decode successfully its the weblookups that dont produce the results

Im not sure what the iphone uses, other than it goes on the internet to search the results

lardman 2010-07-05 22:58

Re: mbarcode
 
I also don't know. Amazon should perform reasonably, but over here one can't easily perform EAN lookups afair.

There are certainly a number of online sources we could use for lookups, take a look at the web.c code in the gtk+ version of mbarcode (they are only partial, but give the base url). When I get some time I'll try writing some more lookup-plugins (unless some of you lot beat me there ;))

See this: https://garage.maemo.org/plugins/scm...de&view=markup

joshn53 2010-07-05 23:11

Re: mbarcode
 
lardman, where would you like for me to post my ISBN plugin? As a patch in the garage tracker?

joshn53 2010-07-05 23:35

Re: mbarcode
 
Quote:

Originally Posted by *Sonic* (Post 741741)
Sorry I should have been clearer, the images captured produce the results required, ie the barcodes scanned decode successfully its the weblookups that dont produce the results

Im not sure what the iphone uses, other than it goes on the internet to search the results

Sonic, are you scanning books specifically? If so, my ISBN plugin may be helpful; it looks up ISBN/EAN numbers on Amazon. It's successfully looked up every book I've tested so far.

lardman 2010-07-06 07:54

Re: mbarcode
 
Quote:

Originally Posted by joshn53 (Post 741767)
lardman, where would you like for me to post my ISBN plugin? As a patch in the garage tracker?

See my PM, but basically I can add you to the project so you can add it directly to SVN yourself, otherwise add it as a bug/enhancement in the bugs.maemo.org tracker.

Thanks :)

weißelstone 2010-07-06 13:29

Re: mbarcode
 
There is a bug in the packaging. The plugins don't depend on the mbarcode application, so you can install the plugins without the application. Normally if you install a plugin the application get's installed, too.

lardman 2010-07-06 13:30

Re: mbarcode
 
Yes that is indeed a bug, I'll fix it this evening.

Thanks! :)

quipper8 2010-07-06 13:37

Re: mbarcode
 
I have the vcard plugin installed(i think part of the qrcode plugin), but doesn't seem to work. I searched this thread, but didn't see anything about it.

Is it supposed to work(i.e. add contact to address book)?

vcard text is recognized and I have a button to open vcard


All times are GMT. The time now is 08:47.

vBulletin® Version 3.8.8