dynobo / normcap

OCR powered screen-capture tool to capture information instead of images
https://dynobo.github.io/normcap/
Other
1.96k stars 89 forks source link

[Windows] Crash upon taking a screenshot #254

Closed nourserry closed 1 year ago

nourserry commented 2 years ago

Hello

When I take a screenshot the app crashes I ran it through cmd and I got this error:

File "C:\Users\REDACTED\AppData\Local\Programs\dynobo\NormCap\app\normcap\gui\tray.py", line 215, in _capture_to_ocr ocr_result = ocr.recognize( File "C:\Users\REDACTED\AppData\Local\Programs\dynobo\NormCap\app\normcap\ocr\recognize.py", line 40, in recognize tsv_data = pytesseract.image_to_data( File "C:\Users\REDACTED\AppData\Local\Programs\dynobo\NormCap\app_packages\pytesseract\pytesseract.py", line 527, in image_to_data return { File "C:\Users\REDACTED\AppData\Local\Programs\dynobo\NormCap\app_packages\pytesseract\pytesseract.py", line 533, in Output.DICT: lambda: file_to_dict(run_and_get_output(*args), '\t', -1), File "C:\Users\REDACTED\AppData\Local\Programs\dynobo\NormCap\app_packages\pytesseract\pytesseract.py", line 288, in run_and_get_output run_tesseract(**kwargs) File "C:\Users\REDACTED\AppData\Local\Programs\dynobo\NormCap\app_packages\pytesseract\pytesseract.py", line 264, in run_tesseract raise TesseractError(proc.returncode, get_errors(error_string))

dynobo commented 2 years ago

Hi @nourserry , thanks for reporting this issue!

Could you please provide some further information?

  1. Version of NormCap
  2. Windows Version + CPU architecture (run systeminfo in cmd)
  3. Did an earlier version of NormCap work for you, or is this the first time you tried?
  4. Oh, and do have Tesseract OCR installed? (If you use the prebuild-package of NormCap, there is no need for that, because it brings it own version of Tesseract. It might cause problems, if you have it installed separately, too.)
igorcmoura commented 1 year ago

Hello! I've run into the same problem. This is the complete output:

Log started: 2022-11-20 15:37:15Z PreInitializing Python runtime... PythonHome: C:\Program Files\dynobo\NormCap PYTHONPATH:

System:

{  'cli_args': '',
   'config_directory': WindowsPath('C:/Users/REDACTED/AppData/Local/normcap'),
   'desktop_environment': <DesktopEnvironment.OTHER: 0>,
   'display_manager_is_wayland': False,
   'envs': {  'LD_LIBRARY_PATH': None,
              'TESSDATA_PREFIX': None,
              'TESSERACT_CMD': 'C:\\Program '
                               'Files\\dynobo\\NormCap\\app\\normcap\\resources\\tesseract\\tesseract.exe',
              'TESSERACT_VERSION': '5.0.0'},
   'gnome_version': None,
   'is_flatpak_package': False,
   'is_prebuild_package': 'briefcase',
   'normcap_version': '0.3.15',
   'platform': 'win32',
   'pyside6_version': '6.4.0.1',
   'qt_library_path': 'C:/Program '
                      'Files/dynobo/NormCap/app_packages/PySide6/plugins, '
                      'C:/Program Files/dynobo/NormCap',
   'qt_version': '6.4.0',
   'screens': {  0: Screen(is_primary=True,
                           device_pixel_ratio=1.0,
                           geometry=Rect(left=0,
                                         top=0,
                                         right=1920,
                                         bottom=1080),
                           index=0,
                           screenshot=None),
                 1: Screen(is_primary=False,
                           device_pixel_ratio=1.0,
                           geometry=Rect(left=4480,
                                         top=0,
                                         right=6400,
                                         bottom=1080),
                           index=1,
                           screenshot=None),
                 2: Screen(is_primary=False,
                           device_pixel_ratio=1.0,
                           geometry=Rect(left=1920,
                                         top=0,
                                         right=4480,
                                         bottom=1080),
                           index=2,
                           screenshot=None)},
   'tessdata_path': WindowsPath('C:/Users/REDACTED/AppData/Local/normcap/tessdata')}

Variables:

   '_capture_to_ocr': {'language': [...], 'self': 'REDACTED'},
   'image_to_data': {  'args': [...],
                       'config': '-c tessedit_create_tsv=1 --oem 3 --psm 1 '
                                 '--tessdata-dir '
                                 '"C:\\Users\\REDACTED\\AppData\\Local\\normcap\\tessdata"',
                       'image': <PIL.Image.Image image mode=RGB size=880x227 at 0x1F7B06DC8B0>,
                       'lang': 'eng',
                       'nice': 0,
                       'output_type': 'dict',
                       'pandas_config': None,
                       'timeout': 30},
   'recognize': {  'image': <PIL.Image.Image image mode=RGB size=880x227 at 0x1F7B06DC8B0>,
                   'languages': [...],
                   'padding_size': 80,
                   'parse': True,
                   'resize_factor': 3.2,
                   'tess_args': TessArgs(path=WindowsPath('C:/Users/REDACTED/AppData/Local/normcap/tessdata'),
                                         lang='eng',
                                         oem=<OEM.DEFAULT: 3>,
                                         psm=<PSM.AUTO_OSD: 1>,
                                         version=<Version('5.0.0')>),
                   'tessdata_path': WindowsPath('C:/Users/REDACTED/AppData/Local/normcap/tessdata')},
   'run_and_get_output': {  'config': '-c tessedit_create_tsv=1 --oem 3 --psm '
                                      '1 --tessdata-dir '
                                      '"C:\\Users\\REDACTED\\AppData\\Local\\normcap\\tessdata"',
                            'extension': 'tsv',
                            'image': <PIL.Image.Image image mode=RGB size=880x227 at 0x1F7B06DC8B0>,
                            'input_filename': 'C:\\Users\\REDACTED\\AppData\\Local\\Temp\\tess_11lqk1fo_input.PNG',
                            'kwargs': {...},
                            'lang': 'eng',
                            'nice': 0,
                            'return_bytes': False,
                            'temp_name': 'C:\\Users\\REDACTED\\AppData\\Local\\Temp\\tess_11lqk1fo',
                            'timeout': 30},
   'run_tesseract': {  'cmd_args': [...],
                       'config': '-c tessedit_create_tsv=1 --oem 3 --psm 1 '
                                 '--tessdata-dir '
                                 '"C:\\Users\\REDACTED\\AppData\\Local\\normcap\\tessdata"',
                       'error_string': b'',
                       'extension': 'tsv',
                       'input_filename': 'C:\\Users\\REDACTED\\AppData\\Local\\Temp\\tess_11lqk1fo_input.PNG',
                       'lang': 'eng',
                       'nice': 0,
                       'output_filename_base': 'C:\\Users\\REDACTED\\AppData\\Local\\Temp\\tess_11lqk1fo',
                       'proc': <Popen: returncode: 3221225501 args: ['C:\\Program Files\\dynobo\\NormCap\\a...>,
                       'timeout': 30}}

Exception:

  pytesseract.pytesseract.TesseractError: (3221225501, '')

Traceback:

  File "C:\Program Files\dynobo\NormCap\app\normcap\gui\tray.py", line 287, in _capture_to_ocr
    ocr_result = ocr.recognize(
  File "C:\Program Files\dynobo\NormCap\app\normcap\ocr\recognize.py", line 39, in recognize
    tsv_data = pytesseract.image_to_data(
  File "C:\Program Files\dynobo\NormCap\app_packages\pytesseract\pytesseract.py", line 527, in image_to_data
    return {
  File "C:\Program Files\dynobo\NormCap\app_packages\pytesseract\pytesseract.py", line 533, in <lambda>
    Output.DICT: lambda: file_to_dict(run_and_get_output(*args), '\t', -1),
  File "C:\Program Files\dynobo\NormCap\app_packages\pytesseract\pytesseract.py", line 288, in run_and_get_output
    run_tesseract(**kwargs)
  File "C:\Program Files\dynobo\NormCap\app_packages\pytesseract\pytesseract.py", line 264, in run_tesseract
    raise TesseractError(proc.returncode, get_errors(error_string))

I did some testing: I've installed the latest version of tesseract (v5.2.0.20220712), added it to the PATH, and removed the part of the code where the path to tesseract is ovewritten, and it worked fine

dynobo commented 1 year ago

Thanks for reporting, @igorcmoura! I'd really like to get this one solved, but still can not reproduce it.

The fact that it's working for you with a custom installed Tesseract could mean, that either your platform (CPU) is incompatible with the shipped Tesseract build or something is wrong regarding the packaging (e.g. I might have missed a dependency).

To rule out the platform hypothesis, could you please run systeminfo in a cmd window and post its output?

EDIT: I just searched for the error code 3221225501 reported by tesseract. It could be a coincidence, but this is also the code of a specific tensorflow error which seems to be related to the platform (CPU), especially the support of AVX instructions. The newer tesseract models work with LSTM-Models, if those are implemented in tensorflow, this could be the root cause of the issue! We should be able to figure out if this is the case from the processor information in your systeminfo output.

igorcmoura commented 1 year ago

Sorry for the late response, I did not see the notification.

Here's the systeminfo output:

Host Name:                 IGOR-PC
OS Name:                   Microsoft Windows 10 Pro
OS Version:                10.0.19044 N/A Build 19044
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Standalone Workstation
OS Build Type:             Multiprocessor Free
Registered Owner:          REDACTED
Registered Organization:
Product ID:                00330-80000-00000-AA448
Original Install Date:     2021-06-02, 12:20:50
System Boot Time:          2022-11-20, 02:23:28
System Manufacturer:       Gigabyte Technology Co., Ltd.
System Model:              To be filled by O.E.M.
System Type:               x64-based PC
Processor(s):              1 Processor(s) Installed.
                           [01]: Intel64 Family 6 Model 58 Stepping 9 GenuineIntel ~3901 Mhz
BIOS Version:              American Megatrends Inc. F13, 2013-02-27
Windows Directory:         C:\Windows
System Directory:          C:\Windows\system32
Boot Device:               \Device\HarddiskVolume1
System Locale:             en-us;English (United States)
Input Locale:              en-us;English (United States)
Time Zone:                 (UTC-03:00) Brasilia
Total Physical Memory:     16,330 MB
Available Physical Memory: 5,761 MB
Virtual Memory: Max Size:  28,544 MB
Virtual Memory: Available: 8,145 MB
Virtual Memory: In Use:    20,399 MB
Page File Location(s):     C:\pagefile.sys
Domain:                    WORKGROUP
Logon Server:              \\IGOR-PC
Hotfix(s):                 16 Hotfix(s) Installed.
                           [01]: KB5020613
                           [02]: KB5000736
                           [03]: KB5003791
                           [04]: KB5012170
                           [05]: KB5019959
                           [06]: KB5006753
                           [07]: KB5007273
                           [08]: KB5011352
                           [09]: KB5011651
                           [10]: KB5014032
                           [11]: KB5014035
                           [12]: KB5014671
                           [13]: KB5015895
                           [14]: KB5016705
                           [15]: KB5018506
                           [16]: KB5005699
Network Card(s):           5 NIC(s) Installed.
                           [01]: WireGuard Tunnel
                                 Connection Name: SurfsharkWireGuard
                                 DHCP Enabled:    No
                                 IP address(es)
                                 [01]: 10.14.0.2
                           [02]: VirtualBox Host-Only Ethernet Adapter
                                 Connection Name: VirtualBox Host-Only Network
                                 DHCP Enabled:    No
                                 IP address(es)
                                 [01]: 169.254.124.210
                           [03]: Realtek PCIe GbE Family Controller
                                 Connection Name: Ethernet
                                 DHCP Enabled:    Yes
                                 DHCP Server:     192.168.0.1
                                 IP address(es)
                                 [01]: 192.168.0.13
                           [04]: Wintunshark Userspace Tunnel
                                 Connection Name: wintunshark0
                                 Status:          Media disconnected
                           [05]: TAP-Surfshark Windows Adapter V9
                                 Connection Name: Ethernet 2
                                 Status:          Media disconnected
Hyper-V Requirements:      A hypervisor has been detected. Features required for Hyper-V will not be displayed.
dynobo commented 1 year ago

Thanks, @igorcmoura. This is rather old processor, correct? ~10 years old? However, it does support the AVX instructions, so that's probably not the problem...

In the upcoming version, I'm going to try a different tesseract binary for Windows, which is much larger in file size but should provide better support for various CPUs. It would be great, if you could give that a try and report back if it helped.

Might take 1-2 weeks until that new version is ready for testing.

dynobo commented 1 year ago

Could you please retry with the new release NormCap v0.4.0? It includes a different tesseract binary for Windows, which might solve some issues.

mr-falafel commented 1 year ago

Hi, I just installed NormCap v0.40, having not used this or any other Tesseract OCR software before, and I am also getting crashes. I am able to take one "screenshot" but the app crashes when I try to take a second one. I do not know how to generate the log that @igorcmoura posted but this is my systeminfo output.

Host Name:                 redacted
OS Name:                   Microsoft Windows 10 Pro
OS Version:                10.0.19044 N/A Build 19044
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Standalone Workstation
OS Build Type:             Multiprocessor Free
Registered Owner:          redacted
Registered Organization:
Product ID:                00330-80000-00000-AA772
Original Install Date:     11/05/2022, 02:21:04 AM
System Boot Time:          06/03/2023, 01:11:39 PM
System Manufacturer:       To Be Filled By O.E.M.
System Model:              To Be Filled By O.E.M.
System Type:               x64-based PC
Processor(s):              1 Processor(s) Installed.
                           [01]: AMD64 Family 25 Model 33 Stepping 0 AuthenticAMD ~3701 Mhz
BIOS Version:              American Megatrends Inc. L1.52, 06/11/2020
Windows Directory:         C:\WINDOWS
System Directory:          C:\WINDOWS\system32
Boot Device:               \Device\HarddiskVolume2
System Locale:             en-gb;English (United Kingdom)
Input Locale:              en-gb;English (United Kingdom)
Time Zone:                 (UTC+00:00) Dublin, Edinburgh, Lisbon, London
Total Physical Memory:     32,694 MB
Available Physical Memory: 27,032 MB
Virtual Memory: Max Size:  37,558 MB
Virtual Memory: Available: 29,244 MB
Virtual Memory: In Use:    8,314 MB
Page File Location(s):     C:\pagefile.sys
Domain:                    WORKGROUP
Logon Server:              \\redacted
Hotfix(s):                 6 Hotfix(s) Installed.
                           [01]: KB5013624
                           [02]: KB5003791
                           [03]: KB5012170
                           [04]: KB5016616
                           [05]: KB5015895
                           [06]: KB5005699
Network Card(s):           5 NIC(s) Installed.
                           [01]: Realtek Gaming 2.5GbE Family Controller
                                 Connection Name: Ethernet
                                 DHCP Enabled:    Yes
                                 DHCP Server:     192.168.1.254
                                 IP address(es)
                                 [01]: 192.168.1.69
                           [02]: Hyper-V Virtual Ethernet Adapter
                                 Connection Name: vEthernet (Default Switch)
                                 DHCP Enabled:    No
                                 IP address(es)
                                 [01]: 172.19.192.1
                           [03]: Bluetooth Device (Personal Area Network)
                                 Connection Name: Bluetooth Network Connection 2
                                 Status:          Media disconnected
                           [04]: Mullvad WireGuard Tunnel
                                 Connection Name: Mullvad
                                 DHCP Enabled:    No
                                 IP address(es)
                                 [01]: 10.119.100.206
                                 [02]: fe80::a8cd:15c:980c:a957
                           [05]: VirtualBox Host-Only Ethernet Adapter
                                 Connection Name: Ethernet 2
                                 DHCP Enabled:    No
                                 IP address(es)
                                 [01]: 192.168.56.1
Hyper-V Requirements:      VM Monitor Mode Extensions: Yes
                           Virtualization Enabled In Firmware: Yes
                           Second Level Address Translation: Yes
                           Data Execution Prevention Available: Yes

This might be obvious from the log but I am running on a Ryzen 5900x, so not a particularly old CPU.

dynobo commented 1 year ago

Hey @mr-falafel, thanks for reporting your issue! Could please provide some more information?

This would help me a lot with this issue :-)

mr-falafel commented 1 year ago

Hope this is right!

Oh and I used the MSI. :)

C:\Users\redacted>Log started: 2023-03-08 23:24:28Z
PreInitializing Python runtime...
PythonHome: C:\Users\redacted\AppData\Local\Programs\dynobo\NormCap
PYTHONPATH:
- C:\Users\redacted\AppData\Local\Programs\dynobo\NormCap\python310.zip
- C:\Users\redacted\AppData\Local\Programs\dynobo\NormCap
- C:\Users\redacted\AppData\Local\Programs\dynobo\NormCap\app_packages
- C:\Users\redacted\AppData\Local\Programs\dynobo\NormCap\app
Configure argc/argv...
Initializing Python runtime...
Running app module: normcap
---------------------------------------------------------------------------
23:24:28 - INFO    - normcap:29 - Start NormCap v0.4.0
23:24:28 - DEBUG   - normcap:208 - [QT] qtwarningmsg - qwindowscontext: oleinitialize() failed:  "com error 0xffffffff80010106 rpc_e_changed_mode (cannot change thread mode after it is set.)"
23:24:28 - DEBUG   - normcap.gui.tray:71 - System info:
{'cli_args': '-- -v debug', 'is_briefcase_package': True, 'is_flatpak_package': False, 'platform': 'win32', 'pyside6_version': '6.4.2', 'qt_version': '6.4.2', 'qt_library_path': 'C:/Users/redacted/AppData/Local/Programs/dynobo/NormCap/app_packages/PySide6/plugins, C:/Users/redacted/AppData/Local/Programs/dynobo/NormCap', 'config_directory': WindowsPath('C:/Users/redacted/AppData/Local/normcap'), 'normcap_version': '0.4.0', 'ressources_path': WindowsPath('C:/Users/redacted/AppData/Local/Programs/dynobo/NormCap/app/normcap/resources'), 'tesseract_path': WindowsPath('C:/Users/redacted/AppData/Local/Programs/dynobo/NormCap/app/normcap/resources/tesseract/tesseract.exe'), 'tessdata_path': WindowsPath('C:/Users/redacted/AppData/Local/normcap/tessdata'), 'envs': {'TESSDATA_PREFIX': None, 'LD_LIBRARY_PATH': None}, 'desktop_environment': <DesktopEnvironment.OTHER: 0>, 'display_manager_is_wayland': False, 'screens': [Screen(is_primary=True, device_pixel_ratio=1.0, rect=Rect(left=0, top=0, right=1920, bottom=1080), index=0, screenshot=None)]}
23:24:28 - DEBUG   - normcap.screengrab:40 - Select capture method QT
23:24:28 - DEBUG   - normcap.gui.tray:43 - Save debug image as C:\Users\redacted\AppData\Local\Temp\normcap\2023-03-08_23-24-28_512047_raw_screen0.png
23:24:28 - DEBUG   - normcap.gui.window:131 - Create window for screen 0
23:24:28 - DEBUG   - normcap.gui.window:193 - Set window of screen 0 to fullscreen
23:24:32 - DEBUG   - normcap.gui.tray:418 - Hide 1 window
23:24:32 - INFO    - normcap.gui.tray:322 - Crop image to region (418, 697, 622, 767)
23:24:32 - DEBUG   - normcap.gui.tray:43 - Save debug image as C:\Users\redacted\AppData\Local\Temp\normcap\2023-03-08_23-24-32_069735_cropped.png
23:24:32 - DEBUG   - normcap.gui.tray:355 - Start OCR
23:24:32 - DEBUG   - normcap.ocr.enhance:54 - Scale image x3.2
23:24:32 - DEBUG   - normcap.ocr.enhance:36 - Pad image by 80px
23:24:32 - DEBUG   - normcap.ocr.recognize:37 - Run Tesseract on image of size (812, 384) with args:
TessArgs(path=WindowsPath('C:/Users/redacted/AppData/Local/normcap/tessdata'), lang='eng', oem=<OEM.DEFAULT: 3>, psm=<PSM.AUTO_OSD: 1>, version='5.2.0.20220712')
23:24:32 - DEBUG   - normcap.ocr.recognize:53 - OCR result:
OcrResult(tess_args=TessArgs(path=WindowsPath('C:/Users/redacted/AppData/Local/normcap/tessdata'), lang='eng', oem=<OEM.DEFAULT: 3>, psm=<PSM.AUTO_OSD: 1>, version='5.2.0.20220712'), words=[{'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 1, 'line_num': 1, 'word_num': 1, 'left': 116, 'top': 131, 'width': 23, 'height': 20, 'conf': 63, 'text': '#'}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 1, 'line_num': 1, 'word_num': 2, 'left': 172, 'top': 115, 'width': 84, 'height': 45, 'conf': 95, 'text': 'On'}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 1, 'line_num': 1, 'word_num': 3, 'left': 280, 'top': 112, 'width': 159, 'height': 48, 'conf': 93, 'text': 'Linux'}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 1, 'line_num': 1, 'word_num': 4, 'left': 460, 'top': 112, 'width': 272, 'height': 58, 'conf': 90, 'text': '(FlatPak):'}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 1, 'line_num': 2, 'word_num': 1, 'left': 175, 'top': 214, 'width': 118, 'height': 46, 'conf': 92, 'text': 'Run:'}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 1, 'line_num': 2, 'word_num': 2, 'left': 346, 'top': 217, 'width': 213, 'height': 55, 'conf': 92, 'text': 'flatpak'}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 1, 'line_num': 2, 'word_num': 3, 'left': 595, 'top': 230, 'width': 86, 'height': 30, 'conf': 93, 'text': 'run'}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 1, 'line_num': 2, 'word_num': 4, 'left': 720, 'top': 243, 'width': 12, 'height': 4, 'conf': 89, 'text': '-'}], image=<PIL.Image.Image image mode=RGB size=812x384 at 0x1CA7A611000>, magic_scores={}, parsed='')
23:24:32 - INFO    - normcap.ocr.magics.email_magic:35 - 0 emails found ['']
23:24:32 - DEBUG   - normcap.ocr.magics.email_magic:46 - 0/40 (0.0) chars in emails
23:24:32 - INFO    - normcap.ocr.magics.url_magic:55 - 0 URLs found ['']
23:24:32 - DEBUG   - normcap.ocr.magics.url_magic:65 - 0/40 (0.0) chars in urls
23:24:32 - DEBUG   - normcap.ocr.magics.magic:77 - Magic scores:
{'SingleLineMagic': 0, 'MultiLineMagic': 50.0, 'ParagraphMagic': 0.0, 'EmailMagic': 0.0, 'UrlMagic': 0.0}
23:24:32 - DEBUG   - normcap.ocr.recognize:57 - Parsed text:
# On Linux (FlatPak):
Run: flatpak run -
23:24:32 - DEBUG   - normcap.gui.tray:43 - Save debug image as C:\Users\redacted\AppData\Local\Temp\normcap\2023-03-08_23-24-32_283074_enhanced.png
23:24:32 - INFO    - normcap.gui.tray:373 - Text from OCR:
# On Linux (FlatPak):
Run: flatpak run -
23:24:32 - DEBUG   - normcap.clipboard.windows:186 - Select clipboard method windll
23:24:32 - DEBUG   - normcap.gui.tray:401 - Copy text to clipboard
23:24:32 - DEBUG   - normcap.gui.notifier:111 - Send notification via QT
23:24:36 - DEBUG   - normcap.gui.tray:165 - Tray event: ActivationReason.Trigger
23:24:36 - DEBUG   - normcap.screengrab:40 - Select capture method QT
23:24:36 - DEBUG   - normcap.gui.tray:43 - Save debug image as C:\Users\redacted\AppData\Local\Temp\normcap\2023-03-08_23-24-36_209205_raw_screen0.png
23:24:36 - DEBUG   - normcap.gui.window:131 - Create window for screen 0
23:24:36 - DEBUG   - normcap.gui.window:193 - Set window of screen 0 to fullscreen
23:24:37 - INFO    - normcap.gui.tray:443 - Exit normcap (notification sent delaying exit)
23:24:37 - DEBUG   - normcap.gui.tray:444 - Debug images saved in C:\Users\redacted\AppData\Local\Temp\normcap
dynobo commented 1 year ago

@mr-falafel , thanks for the log, yeah, that's what I needed :-)

Actually, the log looks like everything is working as expected. NormCap recognized the text:

23:24:32 - INFO    - normcap.gui.tray:373 - Text from OCR:
# On Linux (FlatPak):
Run: flatpak run -

copied it to the clipboard:

23:24:32 - DEBUG   - normcap.gui.tray:401 - Copy text to clipboard

and exited afterwords:

23:24:37 - INFO    - normcap.gui.tray:443 - Exit normcap (notification sent delaying exit)

Maybe it is as misunderstanding of how the app works?

NormCap copies the text of the region you selected into the system clipboard and exit automatically. Sometimes people interpret this as automatic closing as "crash", but it is intended to work like this. You just have to paste (Ctrl+V) the text from the clipboard somewhere, e.g. in Notepad or Word.

Does it work for you like described above?

mr-falafel commented 1 year ago

@dynobo Ah well... Maybe it is working as intended then but the behaviour seems weird. What happens for me is, I open NormCap, I take a screenshot and I can paste it into notepad or wherever, as you said. Upon taking the screenshot, the screen overlay disappears, as you would expect. However, NormCap remains open as a taskbar icon. If I click that icon, the screen overlay appears again for me to take a second screenshot but, when I attempt to do so, the screen overlay and taskbar icon both immediately vanish, giving the appearance of a crash. Is that intended behaviour?

dynobo commented 1 year ago

Thanks for explaining more in detail, @mr-falafel ! No, that is in deed not the intended behavior. I already have idea about what's going wrong here and l will fix it soon. :slightly_smiling_face:

The intended behavior is:

  1. With the option "Keep in System tray" set to "disabled" (the default), the taskbar icon should not be clickable. (That it currently is, that is the bug :bug: ). It should only indicate by color change, when the text was copied to the clipboard, then disappear after a few seconds automatically.
  2. With the option "Keep in System tray" set to "enabled" (can be activated through the cog-wheel in the top right of the overlay), the taskbar icon should remain in the taskbar and a click on it should make the overlay re-appear allowing to select the next region of text.

In case you have any ideas/thought on how to make this behavior more obvious and user friendly, that would be super interesting to me, as I'm always striving for a better usability :slightly_smiling_face:

mr-falafel commented 1 year ago

@dynobo Aha! That all makes sense! I think it would have been more intuitive for me if the taskbar icon actually didn't appear at all until you enable it. Obviously the fact that I was able to click on it made that more confusing. Another thing is that I actually never saw that cog! It might be nice to add a white or black outline around it to make it stand out more. Thanks for addressing my issues! :)

dynobo commented 1 year ago

Another thing is that I actually never saw that cog! It might be nice to add a white or black outline around it to make it stand out more.

That's a good hint! I'll see how I can improve its visibility!

Thanks for you input, @mr-falafel , and stay tuned for the upcoming release :slightly_smiling_face:

igorcmoura commented 1 year ago

Sorry for the late response, @dynobo. I upgraded my processor so I'm unable to test it now 😔 I still have the old processor for a spare computer, but it probably won't be built anytime soon. So it may take a while until I can test it again.

dynobo commented 1 year ago

Don`t worry @igorcmoura , I think it's not worth to reactivate your old processor just for testing this issue here. As long as NormCap works for you on your new machine ;-)