normcap
normcap copied to clipboard
Latest version ( 0.3.7 ) doesn't copy text to clipboard
I'm sorry that I keep discovering issues, but I thought I should let you know that the latest version ( 0.3.7 ) doesn't copy text to the clipboard, atleast on Fedora KDE Wayland. The AppImage of 0.3.5 works. In the CLI output it recognizes the text fine.
Another thing is the AppImage has notifications and tray support, but the flatpak doesn't. Also, the flatpak sometimes doesn't copy to clipboard, even on older versions. The AppImage of 0.3.5 is the most reliable (for me).
Edit: I can confirm that the AppImage of 0.3.7 has the same issue. (0.3.5 works though)
You are using Fedora 35, right? (I tested on 36, there it seemed to work).
The fact that both system tray + notification are affected is making perfectly sense, as notifications are actually handled by the QSystemTrayIcon. I already noticed, that the tray icon and notifications seem to behave a bit different in flatpak vs. appimage. The clipboard problem is more surprising to me, though...
Sorry, that the flatpak is a bit of construction site atm, but I kind of anticipated problems in the first versions after introducing it. So I'm very glad that users like you report any issue they find! :-)
Edit: I can confirm that the AppImage of 0.3.7 has the same issue. (0.3.5 works though)
All those issues?! Or only the clipboard one? :open_mouth:
Could you please run:
./NormCap-0.3.7-x86_64.AppImage -v debug > normcap.log
and then share the log files content here?
You are using Fedora 35, right? (I tested on 36, there it seemed to work).
Nope, Fedora 36 KDE, fully updated.
All those issues?! Or only the clipboard one?
Only the clipboard one for the 0.3.7 AppImage.
18:17:16 - INFO - normcap:38 - Start NormCap v0.3.7
18:17:16 - DEBUG - normcap:47 - Set QT_QPA_PLATFORM=wayland
18:17:16 - DEBUG - normcap:59 - System info:
{'cli_args': '/tmp/.mount_NormCaTft23F/usr/app/normcap/__main__.py -v debug', 'is_prebuild_package': 'briefcase', 'platform': 'linux', 'pyside6_version': '6.2.4', 'qt_version': '6.2.4', 'qt_library_path': '/tmp/.mount_NormCaTft23F/usr/app_packages/PySide6/Qt/plugins, /tmp/.mount_NormCaTft23F/usr/bin', 'config_directory': PosixPath('/home/user/.config/normcap'), 'normcap_version': '0.3.7', 'tessdata_path': '/home/user/.config/normcap/tessdata', 'envs': {'TESSERACT_CMD': '/tmp/.mount_NormCaTft23F/usr/bin/tesseract', 'TESSERACT_VERSION': None, 'TESSDATA_PREFIX': None, 'LD_LIBRARY_PATH': '/home/user/.myLibs'}, 'desktop_environment': <DesktopEnvironment.KDE: 2>, 'display_manager_is_wayland': True, 'gnome_version': None, '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)}}
18:17:16 - DEBUG - normcap.gui.tray:51 - Set up tray icon
18:17:16 - DEBUG - normcap.screengrab.dbus_portal:47 - Use capture method: DBUS portal
18:17:17 - DEBUG - normcap.screengrab.utils:25 - Virtual geometry width: 1920
18:17:17 - DEBUG - normcap.screengrab.utils:26 - Image width: 1920
18:17:17 - DEBUG - normcap.screengrab.utils:27 - Resize ratio: 1.0
18:17:17 - DEBUG - normcap.gui.utils:44 - Store debug image in: /tmp/normcap/2022-08-04_18-17-17_205095_raw_screen0.png
18:17:17 - DEBUG - normcap.gui.window:50 - Create window for screen 0
18:17:17 - DEBUG - normcap.gui.window:198 - Set window for screen 0 to fullscreen
18:17:17 - DEBUG - normcap.gui.window:255 - Move window 0 to position (top=0, left=0, bottom=1080, right=1920)
18:17:23 - DEBUG - normcap.gui.tray:259 - Hide 1 window(s)
18:17:23 - INFO - normcap.gui.tray:181 - Crop image to selected region (647, 388, 746, 421)
18:17:23 - DEBUG - normcap.gui.utils:44 - Store debug image in: /tmp/normcap/2022-08-04_18-17-23_761766_cropped.png
18:17:23 - DEBUG - normcap.gui.tray:213 - Start OCR
18:17:23 - DEBUG - normcap.ocr.enhance:54 - Resize screenshot by factor 3.2
18:17:23 - DEBUG - normcap.ocr.enhance:36 - Pad image by 80 px
18:17:23 - DEBUG - normcap.ocr.enhance:66 - Inverting screenshot
18:17:23 - DEBUG - normcap.ocr.recognize:37 - Init tesseract with args: TessArgs(path='/home/user/.config/normcap/tessdata', lang='eng', oem=<OEM.DEFAULT: 3>, psm=<PSM.AUTO_OSD: 1>, version=<Version('4.0.0')>)
18:17:23 - DEBUG - normcap.ocr.recognize:38 - Image size: (476, 265)
18:17:23 - DEBUG - normcap.ocr.recognize:51 - OCR result: OcrResult(tess_args=TessArgs(path='/home/user/.config/normcap/tessdata', lang='eng', oem=<OEM.DEFAULT: 3>, psm=<PSM.AUTO_OSD: 1>, version=<Version('4.0.0')>), words=[{'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 1, 'line_num': 1, 'word_num': 1, 'left': 80, 'top': 115, 'width': 120, 'height': 48, 'conf': 70, 'text': '-way'}, {'level': 5, 'page_num': 1, 'block_num': 1, 'par_num': 1, 'line_num': 1, 'word_num': 2, 'left': 206, 'top': 102, 'width': 132, 'height': 48, 'conf': 96, 'text': 'Land'}], image=<PIL.Image.Image image mode=RGB size=476x265 at 0x7F2CFBFA1A80>, magic_scores={}, transformed='')
18:17:23 - INFO - normcap.ocr.magics.email_magic:34 - 0 emails found ['']
18:17:23 - DEBUG - normcap.ocr.magics.email_magic:45 - 0/9 chars in emails. Ratio: 0.0)
18:17:23 - INFO - normcap.ocr.magics.url_magic:54 - 0 URLs found ['']
18:17:23 - DEBUG - normcap.ocr.magics.url_magic:64 - 0 of 9 chars in urls (ratio: 0.0)
18:17:23 - DEBUG - normcap.ocr.magics.magic:81 - All scores: {'SingleLineMagic': 50, 'MultiLineMagic': 0, 'ParagraphMagic': 0.0, 'EmailMagic': 0.0, 'UrlMagic': 0.0}
18:17:23 - DEBUG - normcap.ocr.recognize:55 - Transformed text: -way Land
18:17:23 - DEBUG - normcap.gui.utils:44 - Store debug image in: /tmp/normcap/2022-08-04_18-17-23_953599_enhanced.png
18:17:23 - INFO - normcap.gui.tray:227 - Text from OCR:
-way Land
18:17:23 - DEBUG - normcap.gui.utils:281 - Copy to clipboard:
-way Land
18:17:23 - DEBUG - normcap.gui.notifier:29 - Send notification
18:17:23 - DEBUG - normcap.gui.tray:259 - Hide 0 window(s)
Hi @pizzadude,
thanks for the log files. I'm now able to reproduce everything.
For better issue tracking, I created #240 for the notification/tray icon problem, while limiting this issue here to the not working clipboard.
I already started looking into it, but it doesn't seem to be something obvious... My best guess is, that an updated introduced an incompatibility which breaks the copy-to-clipboard functionality of Qt/PySide6, but that's just gut feeling.
Short update: I confirmed, that QT's clipboard works even more unreliably on the newest Wayland, as it did in the past. It seems like pasting doesn't work at all if no window is visible (and maybe even active?). As I expect these problems to arrive in other distributions, too, I'm working on an integration with wl-clipboard. I'm not super happy about adding a new dependency to NormCap, but I don't see a good alternative. Stay tuned.
Should be solved with the release v.0.3.8. Please re-open, if it's not.
Hi, it works now! Thanks. :)