SUMMARY If you save an image with spaces after the file extension, it will not trim off the unneeded spaces. I save templated screenshots using specific filenames I copy and paste from a Libreoffice spreadsheet. I believe that copying from a spreadsheet cell also copys a newline character as well. That also doesn't get trimmed. STEPS TO REPRODUCE 1. Save a screenshot as "myfile.png[space]" (replacing '[space]') with an actual space character. 2. Observe the whitespace in the filename using the 'ls' command-line tool. OBSERVED RESULT Whitespace in filename. EXPECTED RESULT Automatic trimming of whitespace after file extension. SOFTWARE/OS VERSIONS Linux/KDE Plasma: Operating System: Kubuntu 19.10 KDE Plasma Version: 5.17.5 KDE Frameworks Version: 5.66.0 Qt Version: 5.12.4 Kernel Version: 5.3.0-29-generic OS Type: 64-bit Processors: 8 × Intel® Core™ i5-9300H CPU @ 2.40GHz Memory: 7.6 GiB of RAM
Makes sense. Should we also trim spaces at the beginning or are there use cases for that?
I'd say so. Don't believe there is a use-case for spaces at the beginning. Maybe someone else will chime in on that.
Is this something we should really handle in Spectacle, or in the save dialog itself, maybe? If there isn't a valid use case for saving a file with whitespace after the filename in Spectacle, it's likely that the same is true of every other app.
It would make sense to inform the user and (optionally) correct any surrounding whitespace when he enters such a template in the Spectacle configuration dialog. It also makes sense generally in the Save dialog, so I suggest to use two separate tickets.