Bug 118102 - desktop LO can't insert or open Android file over MTP or PTP
Summary: desktop LO can't insert or open Android file over MTP or PTP
Status: RESOLVED DUPLICATE of bug 90217
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
6.0.4.2 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-10 22:54 UTC by skierpage
Modified: 2018-10-19 10:53 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description skierpage 2018-06-10 22:54:58 UTC
I connected my phone over USB and tried to insert a simple JPG image from it into LibreOffice Writer, but got an alert with a gray lightbulb "Unknown image format".

I quickly realized that every file operation over MTP fails, e.g.
* Insert > Image... in LibreOffice Calc displays a large dialog for a split-second, then redisplays the Insert Image file chooser.
* File > Open... a text file silently fails in both applications.
I did limited testing of the older PTP "transfer pictures" protocol, and that seems to fail as well.

Steps to reproduce:
1. Plug in your Android phone (mine is a Pixel 2 running Android 8.1.0) over USB
2. Dismiss Windows' various prompts what to do with the newly-attached device.
3. Find the USB notification on the phone and change the USB connection to MTP. On my phone it's drag windowshade to expose notifications, tap "USB for power", change Use USB to > "Transfer files" (i.e. MTP).
4. Start LibreOffice Writer, and choose Insert > File
5. In the Insert Image dialog, navigate to an image on the phone (on my phone an image saved in Firefox appears in This PC\Pixel 2\Internal shared storage\Download) and click [Open]

Repeat steps 4 and 5 for other LO applications and file access.

Expected results:
From minimal fix to best:
0. Document this limitation somewhere, e.g.
   You cannot open or insert files from a device connected over USB, such as a phone. Neither the Media Transfer Protocol ("transfer files") nor Picture Transfer Protocol ("transfer photos") works. Workaround: copy the file to a local storage location and open, insert, and save the file from there.

1. Don't silently fail or show a wrong dialog such as "Unknown image format", instead display a relevant error. Even something internal like "Vfs stat err inode of file=0xf000 blah blah" would be better than wrong or nothing.
2. Don't even attempt to open files over unsupported protocol. Gray out the folder or files, display "Can't open files over MTP", etc.
3. Support inserting or opening files over MTP. Other programs like Firefox, Notepad, Paint, etc. can all open these files.

Interestingly, Notepad's titlebar shows the file as "<ORIGINAL FILENAME>[1].txt (Read Only)" and Paint shows as "<ORIGINAL FILENAME>[1].jpg"; the [1] suggests these programs can tell the original file path is special. Meanwhile Firefox's location bar suggests it's working on a local copy of the file, in my case file:///C:/Users/spage/AppData/Local/Microsoft/Windows/INetCache/IE/7NFG4Q49/<ORIGINAL FILENAME>.ext.
FWIW I couldn't save to MTP from these applications or from LibreOffice, they all show a Save As alert "<FILENAME>.<EXT> File not found. Check the file name and try again."
Comment 1 Xisco Faulí 2018-10-19 10:53:04 UTC
Thanks for reporting this issue.
it seems like a dupe of bug 90217

*** This bug has been marked as a duplicate of bug 90217 ***