Bug 486542 - Filename (time) does not follow the setting in Image Saving when placeholder <title> is added.
Summary: Filename (time) does not follow the setting in Image Saving when placeholder ...
Status: RESOLVED DUPLICATE of bug 483320
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: 24.02.2
Platform: Arch Linux Linux
: NOR major
Target Milestone: ---
Assignee: Noah Davis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-04 07:22 UTC by Curie
Modified: 2024-05-11 05:59 UTC (History)
1 user (show)

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


Attachments
Screenshot file not correct when title placeholder is included (1.88 MB, image/png)
2024-05-04 07:22 UTC, Curie
Details
Even with a short filename format, if placeholder title is included, it's still produce incorrect filename (2.09 MB, image/png)
2024-05-04 07:24 UTC, Curie
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Curie 2024-05-04 07:22:54 UTC
Created attachment 169173 [details]
Screenshot file not correct when title placeholder is included

## Bug Report for Spectacle - Filename Issue

**SUMMARY**

Spectacle generates incorrect filenames when using the `<title>` placeholder in the filename format with capture modes other than "Active Window". The filename omits seconds and truncates the window title.

**STEPS TO REPRODUCE**

1. Configure the filename format in Spectacle to include the `<title>` placeholder (e.g., `Screenshot_A6213[<#>]_(<yyyy>-<MMMM>-<dd>)_[<hh>,<mm>,<ss>]__<title>`).
2. Open an application window, such as "Firefox".
3. Take a screenshot of the application window using any capture mode except "Active Window" (e.g., "Rectangular Region", "All Screens", "Current Screen"). You can use either a button or a hotkey to trigger the screenshot.

**OBSERVED RESULT**

The filename is generated incorrectly. For example, if the current time is 14:08:36 and the window title is "Firefox", the filename might become `14,08,<ss.jpg` instead of the expected `14,08,36__Firefox.jpg`.

* The filename omits the seconds from the timestamp.
* The filename truncates the window title.

**EXPECTED RESULT**

The filename should be generated according to the configured format, including:

* The full timestamp with seconds (`<hh>,<mm>,<ss>`)
* The captured window title (`<title>`)

**SOFTWARE/OS VERSIONS**

* **Operating System:** Arch Linux
* **KDE Plasma Version:** 6.0.4
* **KDE Frameworks Version:** 6.1.0
* **Qt Version:** 6.7.0
* **Kernel Version:** 6.8.8-arch1-1-surface (64-bit)
* **Graphics Platform:** Wayland

**HARDWARE INFORMATION**

* **Processors:** 8 × Intel® Core™ i7-8650U CPU @ 1.90GHz
* **Memory:** 15.5 GiB of RAM
* **Graphics Processor:** Mesa Intel® UHD Graphics 620
* **Manufacturer:** Microsoft Corporation
* **Product Name:** Surface Book 2
* **System Version:** 124000000000000000000000D:0B:08K:1F:5C:10P:38

**ADDITIONAL INFORMATION**

* This issue only occurs when using the `<title>` placeholder and taking screenshots with capture modes other than "Active Window".
* Interestingly, even though the "Active Window" capture mode setting includes the `<title>` placeholder, it still generates correct filenames with the full timestamp. This suggests the issue might be related to how Spectacle interacts with the `<title>` placeholder when using specific capture methods.

**Optional: Troubleshooting Steps (if any)**

* Briefly describe any troubleshooting steps you've tried (e.g., reinstalling Spectacle, checking for configuration conflicts).

**Full Story**

1. In KDE Plasma 5, I used the following filename format without issues: `Screenshot_A6213[%#]_(%Y%M%D)_[%H%m%S]__{%T}`.
2. After updating to KDE Plasma 6, I noticed Spectacle generated incorrect filenames with this format.
3. I learned that KDE Spectacle developers replaced the old `%` style placeholders with new `< >` style placeholders.
4. Following the new format guidelines, I tried using `Screenshot_A6213[<#>]_(<yyyy>-<MMMM>-<dd>)_[<hh>,<mm>,<ss>]__<title>`.
5. However, this format also resulted in incorrect filenames, like `Screenshot_A6213[2]_(2024-May-04)_[14,06,<ss-2.jpg`.
6. Initially, I thought the issue might be the filename length being too long. I tested with a shorter format (`<hh>,<mm>,<ss>__<title>`) but the problem persisted (filenames like `14,08,<ss.jpg`).
7. This led me to believe the problem was likely with the `<title>` placeholder itself.
8. To confirm this, I noticed that screenshots taken using the "Active Window" capture mode (which does use the `<title>` placeholder in its settings) generated correct filenames with the full timestamp (e.g., `Screenshot_A6213[1]_(2024-May-0
Comment 1 Curie 2024-05-04 07:24:13 UTC
Created attachment 169174 [details]
Even with a short filename format, if placeholder title is included, it's still produce incorrect filename
Comment 2 Curie 2024-05-11 05:58:47 UTC
I think they're the same isse

https://bugs.kde.org/show_bug.cgi?id=483320
Comment 3 Curie 2024-05-11 05:59:00 UTC
*** This bug has been marked as a duplicate of bug 483320 ***