Bug 429056 - Resaving with different mime type does not work on Android
Summary: Resaving with different mime type does not work on Android
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: File formats (show other bugs)
Version: 4.4.0
Platform: Android Android 10.x
: NOR normal
Target Milestone: ---
Assignee: sh_zam
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-13 11:26 UTC by Anna Medonosova
Modified: 2020-11-17 16:15 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anna Medonosova 2020-11-13 11:26:57 UTC
SUMMARY
When trying to save a file, which was opened as JPG, to the native KRA format, JPG file is saved instead of KRA. The native file dialog on Android does not allow me to select a mime type; the suffix of the file name I entered is not considered.

STEPS TO REPRODUCE
1. Open a JPG file 
2. Make a change
3. File -> Save As, rename the file to ‘testfile.kra’

OBSERVED RESULT
On disk, there is a file called testfile.kra.jpg, which is a JPG, not KRA.

EXPECTED RESULT
I would expect either being able to select a mime type in the file dialog or that the saving process selecting a mime type for the file according to the suffix I input.
Comment 1 sh_zam 2020-11-16 08:11:47 UTC
Git commit 7f211e12f0fe60090b75130a747c6e726803a12c by Sharaf Zaman.
Committed on 16/11/2020 at 08:08.
Pushed by szaman into branch 'krita/4.3'.

Android: don't set nameFilters when exporting

Android docs suggest two ways to pass mime info to the Storage Framework
1. Intent#setType() -- when mimetype belongs to some specific category e.g image/*
2. Intent#EXTRA_MIME_TYPES -- for disjoint ones.

But Qt always uses the first mimetype in the list as setType, which for certain
concrete mimeTypes (like image/jpeg), defaults the extension to .jpg which
we/user can't change.

M  +2    -0    libs/widgetutils/KoFileDialog.cpp

https://invent.kde.org/graphics/krita/commit/7f211e12f0fe60090b75130a747c6e726803a12c
Comment 2 sh_zam 2020-11-17 16:15:45 UTC
Git commit 046fbdce77538cc2e7b97ea6d571c5794bc478fa by Sharaf Zaman.
Committed on 17/11/2020 at 16:05.
Pushed by szaman into branch 'master'.

Android: don't set nameFilters when exporting

Android docs suggest two ways to pass mime info to the Storage Framework
1. Intent#setType() -- when mimetype belongs to some specific category e.g image/*
2. Intent#EXTRA_MIME_TYPES -- for disjoint ones.

But Qt always uses the first mimetype in the list as setType, which for certain
concrete mimeTypes (like image/jpeg), defaults the extension to .jpg which
we/user can't change.
(cherry picked from commit 7f211e12f0fe60090b75130a747c6e726803a12c)

M  +2    -0    libs/widgetutils/KoFileDialog.cpp

https://invent.kde.org/graphics/krita/commit/046fbdce77538cc2e7b97ea6d571c5794bc478fa