Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Olf0 opened this issue Apr 18, 2018 · 15 comments
Closed
Labels
enhancement New feature or request

Comments

@Olf0
Copy link

Olf0 commented Apr 18, 2018

Background

  • CodeReader is almost there: It is (was?) working well in landscape orientation, but exposes some minor usability issues.
  • I am using the Patches "Free Rotate for Phone", respectively "Allow any rotation".

Missing pieces

  • In the main screen, the preview window (both, content and frame / window orientation) ought to be rotated by 90° to the left, when in landscape orientation, by 90° to the right, when in inverted landscape orientation and by 180°, when in inverted portrait orientation.
    Without this measure (i.e. currently), aiming at a barcode in landscape orientation provides a clumsy experience, because movements of the hand and device are translated into orthogonal movements of the view within the preview window.
  • The settings screen must be made scrollable.

Notes

  • The detection rate of CodeReader 1.0.0 in landscape orientation seems to be 0 (tried a couple of Barcodes on products), while it works like a charm in portrait orientation. CodeReader versions up to (and including) 0.7.13 did successful scans in landscape orientation.
  • It would be a useful feature (additionally to above suggestion for adapting the default orientation of the preview window) to be able to manually rotate the frame of the preview window (i.e. its orientation, but not its content, in contrast to above suggestion) by 90°, regardless of the current orientation (e.g. by tapping on the preview window or via a pulley entry), so one does not have to rotate the object with the barcode on (which is impractical or even infeasible sometimes) to make it fit in the preview window.
    A likely easier way to accomplish this would be to use a square preview window, as most QR- and Barcode apps do.

@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
Copy link
Owner

monich commented Apr 23, 2018

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.

@monich monich added the enhancement New feature or request label Jun 4, 2018
@Olf0
Copy link
Author

Olf0 commented Jun 4, 2018

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

WRT rotation:

  • It is good to know, that the the app is trying to detect the code in 0° and 90°, already.
    That explains well, why it is detecting codes, although the picture (at least the preview) is rotated.
    BTW, what about 180° and 270°?
  • But the point is: For the user, the preview picture is out-of-sync (by multiples if 90°) with reality!
    I.e. the preview picture is rotated by 90° compared to what is visible behind the phone in landscape orientation, by 180° when in inverted portrait orientation and by 270° when in inverted landscape orientation.
    That is the reason, why I suggested:

In the main screen, the preview window (both, content and frame / window orientation) ought to be rotated by 90° to the left, when in landscape orientation, by 90° to the right, when in inverted landscape orientation and by 180°, when in inverted portrait orientation.
Without this measure (i.e. currently), aiming at a barcode in landscape orientation provides a clumsy experience, because movements of the hand and device are translated into orthogonal movements of the view within the preview window.

@develroo
Copy link

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
Copy link
Author

Olf0 commented Jul 20, 2018

@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:

  • Its aspect ratio switcher allows for switching between a vertically tall (as before, AFAICS) and a vertically extremely tall viewfinder. The latter exacerbates the aforementioned issues in landscape orientation.
    While I like the idea of the aspect ratio switcher, currently it does not alleviate this issue. Offering a square viewfinder (i.e., with an aspect ratio of 1:1) instead of the extremely tall one would, though I do not believe that this is the best way to solve these issues in landscape orientation.
    Side note: IMO the aspect ratio switcher should rather be in the settings, as supposedly one uses a specific aspect ratio on a specific device. Furthermore this allows for a line of text (e.g. "Viewfinder aspect ratio"), describing its function.
  • There is now a large gap between the zoom slider (with flashlight and aspect ratio switchers) and the "Scan" button. This causes the "Scan" button to be that far offscreen, that it is outside of the scrollable range of this window (not only on the Gemini PDA, as @develroo described, also on other devices, e.g. Jolla 1) in landscape orientation.
  • The viewfinder is vertically so large (no matter which of the aspect ratios is used), that one has to scroll to see the zoom slider with flashlight and aspect ratio switchers in landscape orientation. Nice that scrolling works fine, but IMHO scrolling should not be necessary.

Hence my suggestions are:

  • Please eliminate the large gap between the zoom slider (with flashlight and aspect ratio switchers) and the "Scan" button.
  • Please let the viewfinder proper and its content rotate with the device by 0°, 90°, 180° and 270°. If it does that, I think the currently offered aspect ratios are absolutely fine (and no square one should be introduced).

monich added a commit that referenced this issue Feb 3, 2019
In case if GlobalHistogramBinarizer::getBlackMatrix() throws an exception
like this:

  #0 zxing::Exception::Exception () at Exception.h:34
  #1 ReaderException::ReaderException () at ReaderException.h:30
  #2 NotFoundException::NotFoundException () at NotFoundException.h:28
  #3 zxing::GlobalHistogramBinarizer::estimateBlackPoint() at GlobalHistogramBinarizer.cpp:198
  #4 zxing::GlobalHistogramBinarizer::getBlackMatrix () GlobalHistogramBinarizer.cpp:129
  #5 zxing::BinaryBitmap::getBlackMatrix () BinaryBitmap.cpp:40
  ...
@monich
Copy link
Owner

monich commented Apr 14, 2019

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

@Olf0
Copy link
Author

Olf0 commented Apr 15, 2019

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

@Olf0 Olf0 closed this as completed Apr 15, 2019
@Olf0
Copy link
Author

Olf0 commented Apr 16, 2019

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.

  • Codreader 1.0.14 on my "testing" Jolla 1 phone ("looking" at my "production" Jolla 1) looks fine: Screenshot_20190415_001
  • Codreader 1.0.14 on my "production" Jolla 1 phone ("looking" at my "testing" Jolla 1) has a smaller aspect ratio, which looks strange and is inconvenient: Screenshot_20190415_004
  • A freshly installed Codreader 1.0.14 on my Xperia X is also looking fine, similar to the updated one on "testing" Jolla 1: Screenshot_20190416_002

@monich
Copy link
Owner

monich commented Apr 16, 2019

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
Copy link
Author

Olf0 commented Apr 16, 2019

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
Copy link

develroo commented Apr 16, 2019

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
Copy link
Author

Olf0 commented Apr 16, 2019

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

  • The aspect ratio switcher icon (to the right of the magnification slider) shows portrait orientation in your screenshot, while the device is in landscape orientation.
  • The large vertical spacing, which I criticised while testing Codereader v1.0.11, is still there.

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

  • The aspect ratio switcher always shows landscape orientation, when the device is in landscape orientation, regardless of the settings in Codereader's Settings -> Orientation {Primary, Portrait, Landscape, Dynamic} and so does the viewfinder window!
  • The same when the device is in portrait orientation: The aspect ratio switcher and viewfinder window are always displayed in portrait orientation (regardless of the settings in Codereader's Settings -> Orientation).
  • This seems to be the opposite behaviour of your Gemini.

Hence I wonder, ...

  • ... if you have Codereader 1.0.14 installed? See About Codereader in its top pulley.
  • ... if you have any "orientation Patch" (using Patchmanager) installed (e.g. "Free Rotate for Phone" or "Allow any rotation")?
    I do on all my devices.
  • which of Settings -> Display -> Orientation {Dynamic, Portrait, Landscape} in SailfishOS' settings app is selected on your Gemini?
    I use Dynamic on all my devices.
  • if switching Settings -> Orientation {Primary, Portrait, Landscape, Dynamic} in Codereader's settings makes any difference for you?

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
Copy link
Owner

monich commented Apr 16, 2019

@monich
Copy link
Owner

monich commented Apr 16, 2019

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

@develroo
Copy link

develroo commented Apr 17, 2019

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
Copy link
Owner

monich commented Apr 17, 2019

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants