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)

cicer 2010-10-19 21:18

Re: mbarcode
 
It seams that it doesn´t support written accents. Instead of an "á" or an "ó" it displays an square. Is it my problem or an issue with the program.

lardman 2010-10-19 21:20

Re: mbarcode
 
Quote:

Originally Posted by mrsellout (Post 845421)
This is yet another great app for the n900. I've been using it for a few months now and it keeps getting better and better and I want to say thanks... THANK YOU!

Glad you like it :)

Quote:

Originally Posted by mrsellout (Post 845421)
Right you asked for feedback and I'll provide. Yes it does startup quicker. It does feel smoother and the scan on request feature is great. There is one slight issue with the new build though. On startup the display gives a high fps reading (~70fps) until one opens the camera shutter. Now I don't open the shutter first because that loads the camera app, and sometimes it's a while before I actually use the app after starting it. I use this app in conjunction with PresenceVNC so I can copy the barcode into a proprietory Windows application. Sometimes the program needs to be started up and logged into. And sometimes a customer comes into the shop and I have to put the phone down and serve them, all before realising that I've not opened the shutter. So you can understand my concern.

Hmm, interesting. Really the pipeline should be stopped if the shutter is closed, I'll have to talk to Dragly about this as he's the OpenGLES guru.

Quote:

Originally Posted by mrsellout (Post 845421)
One more thing if I may, can you enable the scan to be activated by the spacebar? I tend to use the app with the keyboard open and it's not that easy using the shutter button with the screen up.

This is still a fantastic app even with the little issues.

Thanks again,

mrsellout

Sure, that should be reasonably easy to implement. I'll take a look at it for you (and I also find it a pain to click the shutter button with the screen open while testing tbh!)

lardman 2010-10-19 21:21

Re: mbarcode
 
Quote:

Originally Posted by cicer (Post 845448)
It seams that it doesn´t support written accents. Instead of an "á" or an "ó" it displays an square. Is it my problem or an issue with the program.

The program I imagine. I'll need to check whether the backend supports accented characters or if it's simply a problem with the data being passed through mBarcode. Do you have an example handy for me to test on?

cicer 2010-10-19 22:27

Re: mbarcode
 
I created this one with all the vowels:

lardman 2010-10-20 09:47

Re: mbarcode
 
ZXing generates this output (http://zxing.org/w/decode):
A á
E é
I Ã*
O ó
U ú

and mBarcode generates something with similar end symbols (look at the terminal output. Ignore the fact that on some line most of the data are turned into delta characters, this seems to be caused by not using qPrintable() but instead using the stream operator to send the text to qDebug().)

So the question is really, what sort of encoding does the barcode contain? Afaiu, both libzbar and libdmtx should accept UTF-8, and it is possible to specify this at the beginning of the barcode. See this comment: http://sourceforge.net/tracker/?func...36&atid=928516

Basically it's going to take some more digging I think to work out whether the fault lies with the data (not saying what encoding it uses), the decoders (not guessing correctly or not handling the particular encoding in the data) or mBarcode (loosing the encoding along the way).

We specifically generate the QStrings that pass the data around using .fromUtf8(), so I think we should be handling it correctly. I'll see if there's a way of forcing the decoders to always assume UTF-8 in the absence of any other indicators.

fms 2010-10-20 11:49

Re: mbarcode
 
Confirming that the new mbarcode version from Extras-Devel is way more responsive now.

lardman 2010-10-20 12:07

Re: mbarcode
 
I've just pushed a very minor update to extras-devel which implements focus+scan for 5sec if you press the space button as mrsellout requested.

I've also worked out why the DBus and PythonQt plugins weren't working (my not using QDir very well) and will do some testing to see if I can get these up and running asap. Nothing in Extras-* for these, but they are sat in SVN if anyone wants to take a look.

dragly 2010-10-20 12:39

Re: mbarcode
 
I'll try to get around and fix the fps startup issue. I just haven't found the error in the code yet. I think it could be solved by checking the shutter state one more time.

About the characters, this was something I looked into earlier. The problem is that ISO-8859-something or UTF-8 is usually the encoding used for qr codes, but there is no default encoding in the specification, so everything, including UTF-8, might be used.

In other words, if there is no information about the character encoding used by the qr encoder, there is no way to know what it is. I suggest we go with assuming UTF-8, as it is most universal, unless there are any encoding hints in the code.

dragly 2010-10-20 12:41

Re: mbarcode
 
But we could of course add an user option to change the encoding in case we get it wrong. Or somehow try to "guess" the encoding, if that is at all possible?

lardman 2010-10-20 12:44

Re: mbarcode
 
Quote:

Originally Posted by dragly (Post 846033)
I'll try to get around and fix the fps startup issue. I just haven't found the error in the code yet. I think it could be solved by checking the shutter state one more time.

Ok, cool.

Quote:

Originally Posted by dragly (Post 846033)
About the characters, this was something I looked into earlier. The problem is that ISO-8859-something or UTF-8 is usually the encoding used for qr codes, but there is no default encoding in the specification, so everything, including UTF-8, might be used.

In other words, if there is no information about the character encoding used by the qr encoder, there is no way to know what it is. I suggest we go with assuming UTF-8, as it is most universal, unless there are any encoding hints in the code.

We need to do some testing with popular encoders to see what they use, but yes I'd go for UTF-8 as the default as it's the obvious choice for encoding the barcodes (let's hope it's as obvious to those who write the barcode encoders! ;))

Dragly, any thoughts on giving an indication (e.g. colour the list item) in the ResultsWindow sink list so that users know their tap has been registered?

dragly 2010-10-20 12:56

Re: mbarcode
 
One could hope the encoder developers were thinking the same thing, but when I researched this I found several online encoders using completely different character sets. I don't remember which it was, but there was even one webpage decoding it's own codes with the wrong char encoding :-p

Letting the user choose an encoding manually should hopefully help us out in the cases where everything else fails.

I have no idea why the visual indication of clicking a button in the results list has disappeared, but I'll look into it ASAP. I think I'll do some work on mBarcode by the end of the week.

lardman 2010-10-20 13:12

Re: mbarcode
 
Quote:

Originally Posted by dragly (Post 846052)
One could hope the encoder developers were thinking the same thing, but when I researched this I found several online encoders using completely different character sets. I don't remember which it was, but there was even one webpage decoding it's own codes with the wrong char encoding :-p

Oh dear! :)

Quote:

Originally Posted by dragly (Post 846052)
Letting the user choose an encoding manually should hopefully help us out in the cases where everything else fails.

Sounds good, we'll have to think how to implement this in the UI.

Quote:

Originally Posted by dragly (Post 846052)
I have no idea why the visual indication of clicking a button in the results list has disappeared, but I'll look into it ASAP. I think I'll do some work on mBarcode by the end of the week.

Great news! :)

The list doesn't contain any widgets and uses a custom delegate painter to draw the items, so I imagine the painter will need to be told the location of the selected item so that it can draw e.g. a different background. I don't really know, I got bogged down in the delegate stuff over the past few days and decided to move onto more productive avenues instead.

I'm thinking of moving things like the DBus setup into the same thread that does plugin loading (if possible) just to try to remove as much stuff as possible before the UI is shown. Might also move the gst pipeline setup, but was planning on leaving that for the time being as it will probably necessitate changing how the UI starts up.

I'm also going to split up the qrcode sink into multiple sinks so that for any given payload (e.g. a vCard) it can display separate buttons (i.e. sinks) for both the overall vCard and also the contents. I.e. button to save the vCard, button to dial telephone #s, open URLs, send emails to email addresses, etc.

Oh yes, and get the MECARD reading working as you kindly moved the vCard import to using the QtMobility functions, thanks! :)

lardman 2010-10-20 13:17

Re: mbarcode
 
http://chart.apis.google.com/chart?c...%A9my+Hubscher

This has the BOM encoded at the start to indicate it's UTF-8, which seems to decode properly.


On a completely different note, has anyone else found that you sometimes revert back to continuous scanning until you open the Settings dialog? I thought I'd fixed this but apparently not. Drat! :) - seems to happen to me after I've scanned something. I'll have to check and see what's going wrong there

mrsellout 2010-10-20 13:38

Re: mbarcode
 
Quote:

Originally Posted by lardman (Post 846066)
On a completely different note, has anyone else found that you sometimes revert back to continuous scanning until you open the Settings dialog? I thought I'd fixed this but apparently not. Drat! :) - seems to happen to me after I've scanned something. I'll have to check and see what's going wrong there

Yeah I just noticed that today. I'll update to the new version in a minute. Thanks for that.

lardman 2010-10-20 17:10

Re: mbarcode
 
Ok, fixed the one with the continuing scanning - I think it's because the timed scanning timer is still running if you close the results window quickly after it's got something. I've made it stop when any window is opened now.

I may have also fixed the OpenGLES framerate thing. With the shutter closed at startup I see it start at ~8fps and drop down to 2.5fps or thereabouts. Is that what we're after?

I'm pushing a new version now.

Edit: I should also add that in my efficiency drive, I've paused the pipeline whenever a window is opened. We might need to revisit switching timers off when the app is backgrounded as I have a feeling they remain running.

AgogData 2010-10-23 19:48

Re: mbarcode
 
what happened to mbarcode ? i update it twice till now and it can't detect the firefox barcodes ? before the 2 updates it was perfect but the new updates just messed it up really bad !!!

lardman 2010-10-23 20:54

Re: mbarcode
 
Really?! Can you give me an example URL with one of these and I'll work out what's up?

Nothing has changed with the decoders, just with the UI and handler code, so it really ought to work as before.

AgogData 2010-10-23 21:51

Re: mbarcode
 
Quote:

Originally Posted by lardman (Post 848977)
Really?! Can you give me an example URL with one of these and I'll work out what's up?

Nothing has changed with the decoders, just with the UI and handler code, so it really ought to work as before.

well, earlier i wanted to open a mediafire page which i did many times in the old mbarcode and the camera keeps focusing and flashing infront of the barcode but can't read it or display the URL and now i just tested it in this thread and still the same problem

lardman 2010-10-23 23:37

Re: mbarcode
 
But can you give us an example of a code which isn't working (i.e. a picture - perhaps taken using mBarcode itself...)? Otherwise it's a bit hard to work out what's wrong.

Wikiwide 2010-10-24 00:16

Re: mbarcode
 
Quick reply...

The latest version of mbarcode:

First scanned QR code - all correct, Open URL from QR code plugin.

After returning from results page to camera, locking and unlocking the device, scanning a EAN-13 code, the result page contains the old result from QR code ("open URL"), and it can still open URL of the previously scanned QR code.

It's supposedly problem of interaction between the new version of mbarcode and the unchanged QR code plugin, because the problem wasn't noticed in previous versions of mbarcode (or, maybe, such sequence of events hasn't happened before?).

Thank you for mbarcode! I'm using it in manual mode (no auto-focus, no auto-scan).

AgogData 2010-10-24 09:41

Re: mbarcode
 
Quote:

Originally Posted by lardman (Post 849075)
But can you give us an example of a code which isn't working (i.e. a picture - perhaps taken using mBarcode itself...)? Otherwise it's a bit hard to work out what's wrong.

i dont know how can i post a code example its any barcode, i tested it in all sites (google, facebook, etc.) didn't work
i tried to do as Wikiwide said and i closed the auto focus and auto scan and it worked, i dunno if its better without the auto focus and auto scan or not

lardman 2010-10-24 10:59

Re: mbarcode
 
Quote:

Originally Posted by Wikiwide (Post 849089)
Quick reply...

The latest version of mbarcode:

First scanned QR code - all correct, Open URL from QR code plugin.

After returning from results page to camera, locking and unlocking the device, scanning a EAN-13 code, the result page contains the old result from QR code ("open URL"), and it can still open URL of the previously scanned QR code.

It's supposedly problem of interaction between the new version of mbarcode and the unchanged QR code plugin, because the problem wasn't noticed in previous versions of mbarcode (or, maybe, such sequence of events hasn't happened before?).

Thank you for mbarcode! I'm using it in manual mode (no auto-focus, no auto-scan).

Strange, I can't re-produce that at all. If I scan a QR code I get the results page with the QR code info + plugin buttons, then I close the results page, lock the device, unlock the device and scan an EAN and I get the EAN info + plugin buttons.

lardman 2010-10-24 11:02

Re: mbarcode
 
Quote:

Originally Posted by AgogData (Post 849276)
i dont know how can i post a code example its any barcode, i tested it in all sites (google, facebook, etc.) didn't work
i tried to do as Wikiwide said and i closed the auto focus and auto scan and it worked, i dunno if its better without the auto focus and auto scan or not

Well certainly I'm curious to see why it won't work anywhere for you.

With auto-scanning set on, pressing the shutter button fully down (or the space bar) will give you the option to save the current frame to file. Otherwise there's a little disk icon in the top right-hand corner below the X (close) button.

Please attach an example of a barcode that isn't working for you.

lardman 2010-10-24 14:15

Re: mbarcode
 
Ok, so I've added a function to decode and add MECARD/BizCards, but it's failing to add the contacts to the db. I need to work out whether it's possible to obtain more information from the QtContacts* stuff to work out why (and indeed if using the QContactManager even works under Maemo).

While doing this, I was thinking that it would be useful to let plugins signal the UI/user that they have (un)successfully performed their processing, using e.g. one of those information ribbons.

One option is to let each plugin do its own thing and generate an info ribbon as and when it wishes; another is to provide a slot/signal pair which the plugin can call with a message when it's done (or even while still processing). The latter case would mean we could specify how the messages appear and even keep a record/history, etc.

What are your thoughts Dragly as this would be a slight change to the plugin API?

dragly 2010-10-24 14:28

Re: mbarcode
 
My thoughts on user feedback has been to use the ResultsWindow list. By changing the text/icon, the plugin can show the number of results, an error text etc. That is the reason why there is a timer in the ResultsWindow.

A ribbon is not a bad idea, but I'm afraid that this might spam the user if all the plugins start using this approach. The ribbons are limited to only show one at the time. Without a timeout, each ribbon must be clicked on to go away, and with a timeout the user might not see the info from the ribbon before it is gone.

I believe updating the plugin text or title is the best approach to give the user input on what's going on, unless we want this kind of input in other places than the ResultsWindow?

lardman 2010-10-24 14:45

Re: mbarcode
 
Ah ok, that sounds like a good idea, ignore my previous ribbon thoughts :)

I've just had a look at the QTableView delegate paint callback and (not knowing any better way to do it) I suppose we could store the item number of the last pressed "button" and have the paint event paint that differently to indicate that their tap has actually done something. Any other ideas?

dragly 2010-10-24 14:52

Re: mbarcode
 
No need, I just found my mistake. I had set the "selectionMode" of the QTableView to "NoSelection" some time long ago (for some reason unknown to me now). I have been suspecting the issue to be something like this, I just haven't had the time to figure out what I did wrong before today.

A new (untested) version with the fix has been pushed to SVN now. Hopefully this will give the user some more input.

lardman 2010-10-24 14:58

Re: mbarcode
 
Quote:

Originally Posted by dragly (Post 849510)
My thoughts on user feedback has been to use the ResultsWindow list. By changing the text/icon, the plugin can show the number of results, an error text etc. That is the reason why there is a timer in the ResultsWindow.

Of course the timer is just to allow slow plugins to decide whether they can handle the barcode payload and be added to the list, it's the paint event which asks each plugin for its icon/text/etc., so what one needs to do is to have the plugin alter its icon/text data to whatever is appropriate and then ask for the correct row of the QTableView to be re-drawn to update that information (e.g. calling update() on the QTableView or perhaps QTableViewItem or somesuch)

dragly 2010-10-24 15:01

Re: mbarcode
 
Yes, you're right. My memory was wrong about what the checkPlugins() function was doing. Do you think that update() should be called by having the plugins issue an "imUpdated" signal, or should we periodically update the tableView? The former would probably cause less CPU time and power consumption.

lardman 2010-10-24 15:10

Re: mbarcode
 
I'd go for something along the lines of an ImUpdated() signal as you say to save power on wasted updates, as many plugins probably won't even use this feature.

I've just tested the SelectionMode update and it works well, the only thing we probably need to do is remove the selection after some time (so it acts more like a button effect). Otherwise for e.g. the web search plugin, you return from the web search url list to find the row still selected.

dragly 2010-10-24 15:47

Re: mbarcode
 
On another topic. I figured out how to avoid using Scratchbox for development. I just reinstalled Ubuntu, and figured it would take a couple of hours to get Scratchbox up and running again. That made me think of whether or not I could use Nokia Qt SDK without Scratchbox.

The solution was actually quite simple. Download and extract the armel versions of libdmtx-dev and libzbar-dev and their dependencies (libdmtx and libzbar). Copy the usr folders to the following path, where <NokiaQtSDK> is where you have installed the SDK:
Code:

<NokiaQtSDK>/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1030-slim
And that's it! Finally I can compile mbarcode without opening Scratchbox, and run it directly on the device :)

I will have to install Scratchbox again if I need to test packaging some time in the future, thought, but for now this was a very easy option :) I thought I should share it here in case anyone else wants to hack on mbarcode, but feels that installing and setting up Scratchbox is a bit cumbersome.

dragly 2010-10-24 15:48

Re: mbarcode
 
Quote:

Originally Posted by lardman (Post 849541)
it works well, the only thing we probably need to do is remove the selection after some time (so it acts more like a button effect). Otherwise for e.g. the web search plugin, you return from the web search url list to find the row still selected.

I agree. I suppose we could set the selection to None after a specified amount of time or something. After all, the user needs some input on the click, not the selection :)

mrsellout 2010-10-24 15:52

Re: mbarcode
 
Apologies for butting in to your conversation here, but I had an idea that might work.

You implemented the 'push to scan feature' to save power & cpu usage right? In my use of this app, I wait until I have the barcode in the window before pushing spacebar (thanks again!). In a similar vein of user-interaction, how about having the user select which plugin s/he wants to use by having a different letter on the bottom row of the keyboard call a different plugin. They already know what type of barcode they are scanning so just need to hit the right key. So to scan a standard barcode you press spacebar, to scan a QR url press m, etc..

This could be optional like the push to scan, and I propose the bottom row because you can just edge the keyboard open.

Just a thought, and I'll crawl back under my rock now, the app is perfect for my needs as it stands!

dragly 2010-10-24 15:56

Re: mbarcode
 
Not a bad idea at all. I guess adding an option for which button to press in the Plugins Settings window could let the users customize this as well :)

lardman 2010-10-24 17:33

Re: mbarcode
 
Quote:

Originally Posted by dragly (Post 849574)
I agree. I suppose we could set the selection to None after a specified amount of time or something. After all, the user needs some input on the click, not the selection :)

I think it should be possible to clear the selection (by using iirc the clear() method of the QSelectionModel associated with the table), I'll have a look at how to do this.

lardman 2010-10-24 17:36

Re: mbarcode
 
Quote:

Originally Posted by mrsellout (Post 849578)
Apologies for butting in to your conversation here, but I had an idea that might work.

You implemented the 'push to scan feature' to save power & cpu usage right? In my use of this app, I wait until I have the barcode in the window before pushing spacebar (thanks again!). In a similar vein of user-interaction, how about having the user select which plugin s/he wants to use by having a different letter on the bottom row of the keyboard call a different plugin. They already know what type of barcode they are scanning so just need to hit the right key. So to scan a standard barcode you press spacebar, to scan a QR url press m, etc..

This could be optional like the push to scan, and I propose the bottom row because you can just edge the keyboard open.

Just a thought, and I'll crawl back under my rock now, the app is perfect for my needs as it stands!

Certainly keyboard shortcuts would be fine by me, but perhaps more importantly, I think we ought to be able to select plugins to automatically be run for a given barcode content type (e.g. if scanning a load of books, it would be good to not have to press the extra button on the results window). Perhaps when we get round to sorting out the Plugin Settings window ;)

lardman 2010-10-24 18:17

Re: mbarcode
 
Ok, I've just committed a change which removes the selection after 1000ms, so it now looks somewhat like a button-press to the user (which should hopefully let them know the UI has seen what they've done - i.e. pressed one of the plugin rows/buttons.)

Edit: I've just pushed an updated package to extras-devel too.

lardman 2010-10-24 21:32

Re: mbarcode
 
Talking about the current SVN code.

Strange, reading in an MECARD generated here (http://www.quickmark.com.tw/en/diy/?qrMeCard) I can correctly pull out the elements, though they way they encode the address fields doesn't match the iMode spec (http://www.nttdocomo.co.jp/english/s...ook/index.html), but for some reason I get error 3 returned by the QtMobility ContactManager, which means InvalidDetailError (see http://qt.gitorious.org/qt-mobility/...ntactmanager.h)

Each contact detail is reported as being added successfully to the contact object (e.g. name, phone number, address, etc., etc.) Any ideas chaps? I guess I'll have to do some digging through the QtMobility source code to see what causes this particular error code.

donj541 2010-10-26 05:08

Re: mbarcode
 
Hi, I have tested Mbarcode for a couple of times now. Today I updated my n900 firmware to PR 1.3 and updated mbarcode to 0.2.3.3. Since then mbarcode stopped working. After I scanned the barcode of my Ananomy book, Logitech gaming headset, and few other stuff, it takes me to the "Results from scan" page. All i see is Results for "0097855062178" and nothing after that. There is no link or anything. It used to show me a list of link such as google, amazon or something similar. But now nothing. Is it because I updated my firmware? please help. I really in need of this.

sconf 2010-10-26 06:55

Re: mbarcode
 
Quote:

Originally Posted by donj541 (Post 851334)
All i see is Results for "0097855062178" and nothing after that. There is no link or anything.

Same here, except I tried mbarcode first time after upgrading. At startup mbarcode says "Could not load: .....so" for every plugin.


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

vBulletin® Version 3.8.8