Bug 481478

Summary: File save dialog shouldn't append ".jpeg" to the filename when the user specifies ".jpg"
Product: [Plasma] plasma-integration Reporter: Ilya Bizyaev <bizyaev>
Component: generalAssignee: Plasma Bugs List <plasma-bugs-null>
Status: REPORTED ---    
Severity: normal CC: fanzhuyifan, shubhamarora
Priority: NOR Keywords: qt6
Version First Reported In: 5.93.0   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Ilya Bizyaev 2024-02-17 18:56:31 UTC
STEPS TO REPRODUCE
1. Edit a test.jpeg image in Gwenview
2. Click “Save as”
3. With the “Automatically select file extension (.jpeg)” checkbox checked, specify "cropped.jpg" as the output name

OBSERVED RESULT
The new image is saved as "cropped.jpg.jpeg".

EXPECTED RESULT
The new image should be saved as "cropped.jpg".

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20240208
KDE Plasma Version: 6.0.80
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.1
Kernel Version: 6.7.4-1-default (64-bit)
Graphics Platform: Wayland

ADDITIONAL INFORMATION
Comment 1 Shubham Arora 2024-02-18 04:57:01 UTC
I think this not a valid issue. The option for Automatically select file extension is here so the text entered in the filename is treated as a title and the the extension appended to it.  When it is unchecked the filename is treated as complete name with extension and is working as expected. 

UX can do with some improvements but functionality is intentional.
Comment 2 Ilya Bizyaev 2024-02-18 11:17:06 UTC
Well, I disagree: saving a file as “test.png” doesn't make it a “test.png.png”. The automatic extension should just be slightly smarter to recognize that “.jpg” and “.jpeg” are the same extension.
Comment 3 fanzhuyifan 2024-02-18 16:39:46 UTC
Yeah I think there might be some way it could figure that out from the MIME database, but I am not an expert on that