SUMMARY I had Spectacle to save my screenshots under folders that change every month and year. This has been working perfectly fine between the months of August to February where now the program does make these folders when I save or copy the image to the clipboard, but I get an error of "Cannot Save Screenshot. Error while writing temporary local file." when I try to drag and drop the image into applications I want to send it to. STEPS TO REPRODUCE 1. Set the save location file name to have a subfolder. (i.e. "%Y-%M/Screenshot_%T_%Y%M%D_%H%m%S") 2. Close the program. 3. Take a screenshot. 4. Try to drag and drop the image. OBSERVED RESULT Error with "Cannot Save Screenshot. Error while writing temporary local file." EXPECTED RESULT To drag the image and drop it to any program without issue. SOFTWARE/OS VERSIONS Linux/KDE Plasma: KDE neon 5.18.0 (Kernel 5.3.0-28-generic) (available in About System) KDE Plasma Version: 5.18.0 KDE Frameworks Version: 5.67.0 Qt Version: 5.13.2 ADDITIONAL INFORMATION
I have the same Problem. I've also configured Subfolders based on date. My save filename is set to to "%Y/%M/screen-%2d". Ran spectacle in strace and saw it try to open a file in /tmp without mkdir-ing the subfolders first, thus failing. openat(AT_FDCWD, "/tmp/Spectacle.MIzolT/2020/02/screen-01.png", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0666) = -1 ENOENT (No such file or directory) The temporary dir exists, the subfolders do not: % tree /tmp/Spectacle.MIzolT /tmp/Spectacle.MIzolT 0 directories, 0 files After that I ran mkdir -p /tmp/Spectacle.MIzolT/2020/02/ and tried again, no error occurred then and the screenshot was saved correctly: % tree /tmp/Spectacle.MIzolT /tmp/Spectacle.MIzolT └── 2020 └── 02 └── screen-01.png 2 directories, 1 file So spectacle should do either of: 1. Create the subdirs if they do not exist, as it does when savong normally 2. Strip the subdirs when saving temporarily VERSION INFORMATION % spectacle --version spectacle 19.12.2 Operating System: Arch Linux KDE Plasma Version: 5.18.2 KDE Frameworks Version: 5.67.0 Qt Version: 5.15.0 Kernel Version: 5.5.6-arch1-1
Created attachment 127406 [details] patch for creating subdirs in tmp dir I've been using this patch for a while now with 0.03.90 and 0.03.80. Worked fine for me, but I'm not sure if that's the way to properly do it. localSave() uses similar code, though.
Created attachment 127407 [details] correct patch for creating subdirs in tmp dir Sorry, wrong patch file, this is the correct one.
Thanks for the patch! Can you submit it using https://phabricator.kde.org? See https://community.kde.org/Get_Involved/Issue_Reporting#Submit_patches_using_Phabricator.2C_not_the_issue_tracker
oh, I thought that was for dev's only not for "casual patch posting". Sorry. Will try submitting to phabricator soon.
Did I do it right? https://phabricator.kde.org/D28702
You did! Let's continue there.
Git commit 464dde9677f4270c5d2ecfddf45c192a33493efe by Nate Graham, on behalf of Franz Baumgärtner. Committed on 13/04/2020 at 01:33. Pushed by ngraham into branch 'release/20.04'. Fix inability to Drag+Drop screenshot due to subfolder in filename Summary: Fixes the mentioned bug by creating all necessary subdirectories. Test Plan: 1. Set save Filename in Spectacle to one including one or more `/`, thus including subdirectories. Example: `%Y/%M/screen-%2d` 2. Take a screenshot 3. Start dragging the preview Reviewers: #spectacle, davidre, ngraham Reviewed By: #spectacle, davidre, ngraham Subscribers: ngraham, davidre, #spectacle Tags: #spectacle Differential Revision: https://phabricator.kde.org/D28702 M +2 -1 src/ExportManager.cpp https://commits.kde.org/spectacle/464dde9677f4270c5d2ecfddf45c192a33493efe