Bug 504047 - Spectacle fails to save screenshots if file name contains reserved characters on NTFS partitions with windows_names mount option
Summary: Spectacle fails to save screenshots if file name contains reserved characters...
Status: ASSIGNED
Alias: None
Product: Spectacle
Classification: Applications
Component: General (other bugs)
Version First Reported In: 23.08.5
Platform: Kubuntu Linux
: VLO minor
Target Milestone: ---
Assignee: Noah Davis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-05-11 08:52 UTC by Ahmet Sait
Modified: 2025-05-14 09:15 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ahmet Sait 2025-05-11 08:52:17 UTC
SUMMARY
Spectacle fails to save screenshots if file name contains reserved characters on NTFS partitions with `windows_names` mount option. This usually happens when the window that is being captured has reserved characters in the title.
More info: https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions

STEPS TO REPRODUCE
1. Mount a NTFS partition with `windows_names` option.
2. Set screenshot save location to somewhere in the mounted NTFS partition.
3. Set filename template to something that contains `%T`.
4. Take a screenshot of a window that contains reserved characters.

OBSERVED RESULT
Two error dialogs with the following text:
1. QImageWriter cannot write image: Cannot open device for writing: Invalid argument
2. Cannot save screenshot. Error while writing file.

EXPECTED RESULT
Successfully saving screenshots with a normalized filename.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
KDE Plasma Version: 5.27.12
KDE Frameworks Version: 5.115.0
Qt Version: 5.15.13
Comment 1 Nate Graham 2025-05-13 18:33:41 UTC
This may fall into the "then don't do that" category. :) It's probably feasible to eventually fix, but the effort-to-reward ratio is probably not very good.
Comment 2 Bug Janitor Service 2025-05-14 09:15:30 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/spectacle/-/merge_requests/453