monich / sailfish-barcode

Barcode reader for Sailfish OS.
https://openrepos.net/content/slava/barcode
13 stars 12 forks source link

[Feature suggestion] Let CodeReader fully support landscape orientation #1

Closed Olf0 closed 5 years ago

Olf0 commented 6 years ago

Background

Missing pieces

Notes

@monich, thank you so much for maintaining this extremely useful app, providing functionality the SailfishOS (native) software ecosystem would be simply lacking without it.

monich commented 6 years ago

Not that I really feel the need for landscape orientation but I have redesigned the settings page which gets us one step closer to that.

Regarding rotation, the app is trying to decode both straight and 90° rotated version of every captured picture. Rotating the preview wouldn't change anything.

I'll consider other suggestions when I have time for that.

Olf0 commented 6 years ago

The settings page in v1.0.10 is looking nice in portrait and landscape orientation. Thanks!

WRT rotation:

develroo commented 6 years ago

If I might just point out that the Gemini PDA is a primary landscape devices. As it stands CodeReader will not work in that orientation because the scan now button falls off the bottom of the screen and you cannot scan. Reorientate it portrait and it works fine. But Landscape is the normal orientation.

Thanks.

Olf0 commented 6 years ago

@monich, I forgot to mention, that the detection in landscape is working fine (but, see below) and the detection rate has become really good (on par with barcode scanners for Android) and quick with the latest releases of CodeReader (tested with v1.0.11 from Jolla Store). Thanks!

But unfortunately the redesigned viewfinder (with aspect ratio switch) has some flaws IMHO:

Hence my suggestions are:

monich commented 5 years ago

Build 1.0.14 should fully support landscape. Just submitted it to the Jolla Store. Let me know if something is still missing.

Olf0 commented 5 years ago

Nice, thanks! This is looking good, I cannot think of other improvements WRT landscape support.

Olf0 commented 5 years ago

Oh, the size of the viewfinder window of Codereader 1.0.14 differs on my "production" Jolla 1 phone and my "testing" Jolla 1. I already wondered about the small size and not very wide aspect ratio on my "production" Jolla 1, until I saw that it looks absolutely fine on my "testing" Jolla 1 (Codereader was updated to v1.0.14 per the Jolla Store app on both Jolla 1s) and freshly installed on an Xperia X.

I assume the difference in the size and aspect ratio of the viewfinder window originates from a setting, which is not accessible at the GUI, anymore. Edit: Just use the aspect ratio switcher icon to the right of the zoom slider. Is /home/nemo/.local/share/harbour-barcode/harbour-barcode/QML/OfflineStorage/Databases/\<id>.sqlite where the settings are stored?

Nevertheless, IMO it would be nice if Codereader resets this aspect ratio value (or whatever causes the differing viewfinder windows) upon updating it, now that its main window layout suits landscape orientation well.

monich commented 5 years ago

Icon button on the right of the zoom slider switches the aspect ratio.

And no, aspect ratio is not in the database, settings are stored in dconf these days. The app copies old settings from the database to dconf when it finds them there, drops the "settings" table and keeps using dconf:

https://github.com/monich/sailfish-barcode/blob/master/src/Database.cpp#L233

You can read aspect ratio setting from dconf like this:

dconf read /apps/harbour-barcode/wide_mode
Olf0 commented 5 years ago

Thanks for the prompt reply and the information WRT Codereader's settings.

As this turned out to be simply a usage issue ("the real issue most often sits in front of the device"), I am glad that I did not reopen this issue, yesterday. So all is fine and working well for me with Codereader 1.0.14. Cheers!

develroo commented 5 years ago

Yup can confirm it seems to work properly on the Gemini PDA now. Cool.

Thanks for that!

Edit: Actually just looking at the others images.. I can see the view port is smaller and there seems to be more space below it on the Gemini.

Screenshot-19-04-16-17-57-40

Olf0 commented 5 years ago

@develroo, your comment made me trying to reproduce the behaviour of your Gemini:

Checking the exact behaviour on one of my Jolla 1s:

Hence I wonder, ...

I hesitate to reopen this issue yet (i.e., without further analysis), because on my devices everything is working well now, even though not completely as expected (as Coderader's orientation setting does nothing).

monich commented 5 years ago

I guess Screen.sizeCategory on Gemini is Screen.Large or Screen.ExtraLarge:

https://github.com/monich/sailfish-barcode/blob/master/qml/pages/ScanPage.qml#L49

https://sailfishos.org/develop/docs/silica/qml-sailfishsilica-sailfish-silica-sailfish-silica-screen.html/

monich commented 5 years ago

Perhaps I should use landscape layout for Screen.Large too...

develroo commented 5 years ago

That would make sense. The Screen Resolution for the Gemini is 2160×1080 @ 403 dpi

Functionally it works fine though.. just the viewport is teeny weeny.

@Olf0

FTR yes. is is v 1.0.14 and like I say works well otherwise :)

Yes.. by default the orientation is set to dynamic. And the icon on the right does nothing when pressed.

Screenshot-19-04-17-14-59-54 Screenshot-19-04-17-14-59-43 Screenshot-19-04-17-14-59-31

monich commented 5 years ago

I'll consider using landscape layout for the capture view on all devices regardless of their sizeCategory. It does look wrong. In the meantime you can edit ScanPage.qml on your device and take out Screen.sizeCategory check :)