Bug 496010 - Saved images on Android are zero bytes
Summary: Saved images on Android are zero bytes
Status: RESOLVED FIXED
Alias: None
Product: Tokodon
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Android Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-09 14:10 UTC by Joshua Goins
Modified: 2024-11-10 20:24 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joshua Goins 2024-11-09 14:10:17 UTC
***
If you're not sure this is actually a bug, instead post about it at https://discuss.kde.org

If you're reporting a crash, attach a backtrace with debug symbols; see https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports

Please remove this comment after reading and before submitting - thanks!
***
The file is created, but it's zero bytes.


SUMMARY


STEPS TO REPRODUCE
1. 
2. 
3. 

OBSERVED RESULT


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: 
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Joshua Goins 2024-11-10 20:24:35 UTC
Git commit 81ff09be60b2e81f4c01db93364fe4f09b03ed25 by Joshua Goins.
Committed on 10/11/2024 at 20:24.
Pushed by redstrate into branch 'master'.

Fix files not saving on Android

It turns out to be two little nagging bugs. First, we are checking if
the temporary file is readable on Android (it never is) and fails.
Secondly, we need to not convert the content:// URI to a local file URI
since that fails. Finally, we need to enable direct write fallback for
QSaveFile because yet again, we cannot write anywhere else in the
directory on Android.

M  +7    -2    src/utils/filehelper.cpp
M  +1    -1    src/utils/filehelper.h
M  +6    -2    src/utils/filetransferjob.cpp

https://invent.kde.org/network/tokodon/-/commit/81ff09be60b2e81f4c01db93364fe4f09b03ed25
Comment 2 Joshua Goins 2024-11-10 20:24:59 UTC
Git commit 2f278e970dcc107cfa8b61fdc13377651146314b by Joshua Goins.
Committed on 10/11/2024 at 20:24.
Pushed by redstrate into branch 'release/24.12'.

Fix files not saving on Android

It turns out to be two little nagging bugs. First, we are checking if
the temporary file is readable on Android (it never is) and fails.
Secondly, we need to not convert the content:// URI to a local file URI
since that fails. Finally, we need to enable direct write fallback for
QSaveFile because yet again, we cannot write anywhere else in the
directory on Android.
(cherry picked from commit 81ff09be60b2e81f4c01db93364fe4f09b03ed25)

M  +7    -2    src/utils/filehelper.cpp
M  +1    -1    src/utils/filehelper.h
M  +6    -2    src/utils/filetransferjob.cpp

https://invent.kde.org/network/tokodon/-/commit/2f278e970dcc107cfa8b61fdc13377651146314b