Bug 328975

Summary: "Missing export filter" when saving a file when no extension is given in File Name
Product: [Applications] krita Reporter: vanyossi <ghevan>
Component: File formatsAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: halla, info, s.g.perryman
Priority: NOR    
Version: git master (please specify the git hash!)   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: [ ^ screenshot of the bug's dialog ]
[ ^ screenshot my actual 'save' dialog on Krita Gnome-Shell ]

Description vanyossi 2013-12-18 18:26:29 UTC
When "saving" if not extension is specified (even if selecting a File type is set to a format), Saving fails with "Missing import filter" window.

Reproducible: Always

Steps to Reproduce:
1. Go to File Save dialog
2. Set a name for the file with no extension. like: "mycool_drawing"
3. Press Save
Actual Results:  
Save fails, missing import filter dialog appears

Expected Results:  
File is saved as:
Kra: if combobox set in "all supported files"
Format selected from combobox.


When there is a File name set like "example.png" and I select "All supported types" the extension changes to ".kra". But it doesn't work when no extension is given. ie when saving a new file.

If I select "jpeg" in the combobox format area and write a name with no extension: it fails. if I write, after selecting jpeg, "name.png" the png dialog shows, not the jpeg as expected.

From IRC:
 frinring: yes, somehow something ignores the selected mimetype and tries to estimate the mimetype from the filename again
(12:45:48) frinring: which yields "application/octet-stream" with no extension. of course there is no filter for that :)
Comment 1 David REVOY 2013-12-18 18:34:17 UTC
I also confirm this bug here  , this is something I talk about on the 3rd comment of the bug 328761 from the 12 December 2013.
Comment 2 Halla Rempt 2013-12-31 10:50:30 UTC
Either that commit by Dmitry fixed this issue or it's a matter of which kdelibs you have -- it works correctly for me, I'm afraid.
Comment 3 vanyossi 2013-12-31 17:44:37 UTC
Still get the bug in latest master.

Krita version
2.9 (git 59a58b0)

Kde libs
4.10.5

which kdelibs version should I have?
Comment 4 Shaun Perryman 2014-02-07 22:59:13 UTC
This happens to me to on Git Master with Ubuntu 13.10/Saucy, 14.04/Trusty and with Krita in Ubuntu 14.04 repositories: krita (1:2.7.91-0ubuntu5).
Krita in Ubuntu 13.10 repositories file saving works OK, version krita (1:2.7.2-0ubuntu2)

This is what happened:-

*   Draw something in a new file.
*   File > Save As...
*   Type a filename without an extension
*   Select a "Files of type" from the dropdown menu
*   Click Save. An error message appears: Missing Export Filter - Krita (dialog title) Could not export file (OK)

Try again by manually adding file extension e.g. .kra at the end of filename and the file saves correctly.

kdelibs in saucy is 4:4.11.2-0ubuntu2
saucy-updates is 4:4.11.3-0ubuntu0.1
trusty is 4:4.12.2-0ubuntu1

So to summarise, file saving with version 2.7.2 in Saucy repo is OK, but Trusty 2.7.91 version in repo is faulty, and Git Master on both is faulty.
Comment 5 David REVOY 2014-02-08 15:22:34 UTC
Created attachment 85047 [details]
[ ^ screenshot of the bug's dialog ]

I confirm what Shaun Perryman reported on the previous comment. I can reproduce 
On 2.8 branch built on Ubuntu 13.10 , Gnome edition. 
>> ( Gnome 3.10, Ubuntu 13.10 , Linux 3.11.0-15 , Nvidia 319.32 , Xorg 1.14.5 , KDEdev 4.11.3, Qt 4.8.4 )
Comment 6 Halla Rempt 2014-02-08 15:31:52 UTC
Yes. basically, it's a matter of using a non-KDE file dialog... They don't 
report back the chosen mimetype or add the extension. We might be able to 
do something about it, but for now, if you dont use kde, you have to 
remember to add the extension manuall...

On Sat, 8 Feb 2014, David REVOY wrote:

> https://bugs.kde.org/show_bug.cgi?id=328975
>
> --- Comment #5 from David REVOY <info@davidrevoy.com> ---
> Created attachment 85047 [details]
>  --> https://bugs.kde.org/attachment.cgi?id=85047&action=edit
> [ ^ screenshot of the bug's dialog ]
>
> I confirm what Shaun Perryman reported on the previous comment. I can reproduce
> On 2.8 branch built on Ubuntu 13.10 , Gnome edition.
>>> ( Gnome 3.10, Ubuntu 13.10 , Linux 3.11.0-15 , Nvidia 319.32 , Xorg 1.14.5 , KDEdev 4.11.3, Qt 4.8.4 )
>
> -- 
> You are receiving this mail because:
> You are on the CC list for the bug.
> You are watching the assignee of the bug.
>
Comment 7 David REVOY 2014-02-08 15:57:43 UTC
Created attachment 85048 [details]
[ ^ screenshot my actual 'save' dialog on Krita Gnome-Shell ]

>> @Boud said : Yes. basically, it's a matter of using a non-KDE file dialog... 
I understand. Just to let you know, I attach here the Save dialog screenshot used by my Krita installation on Gnome-Shell. I thought this was a KDE dialog ( oxygen / theming / kde-bookmarks , and even single-click default rules to handle folders and files ). So, if not KDE and themed, this is just handled by Qt ?
Comment 8 Halla Rempt 2014-02-08 16:01:50 UTC
No, that's the Qt one. I have explicitly disabled the GTK one because it 
causes hangs.
Comment 9 David REVOY 2014-02-08 16:12:46 UTC
>>  that's the Qt one
Good to know. Thanks ! Yes, I remember the hang of the 'GTK one' ; I was using XFCE at this time. This Qt one works far better, no big trouble for me here as I'm used to write extension manually when I 'save as' .
Comment 10 Halla Rempt 2014-02-19 11:20:27 UTC
Some relevant work is being done:

https://git.reviewboard.kde.org/r/115611/
Comment 11 Halla Rempt 2014-04-09 14:13:28 UTC
Git commit 157401c579713a9b7a841005fcafe256660f802b by Boudewijn Rempt.
Committed on 09/04/2014 at 14:09.
Pushed by rempt into branch 'master'.

Set the default suffix when selecting a mimetype

M  +12   -1    libs/widgets/KoFileDialog.cpp

http://commits.kde.org/calligra/157401c579713a9b7a841005fcafe256660f802b
Comment 12 Halla Rempt 2014-04-10 08:27:15 UTC
Git commit fa0a1c84e5e79ced9a91cddae4783dcdf501bb06 by Boudewijn Rempt.
Committed on 09/04/2014 at 14:09.
Pushed by rempt into branch 'calligra/2.8'.

Set the default suffix when selecting a mimetype

M  +12   -1    libs/widgets/KoFileDialog.cpp

http://commits.kde.org/calligra/fa0a1c84e5e79ced9a91cddae4783dcdf501bb06