Anki-android: Google Photos Image Import Fails if downloading

Created on 11 Apr 2020  路  5Comments  路  Source: ankidroid/Anki-Android

Reproduction Steps
  1. Open Note Editor
  2. Add Image
  3. Select from Gallery and use Google Photos app
  4. Select an image which requires a download
Expected Result
  1. Image appears
Actual Result
  1. No image appears after download. No failure message.
Debug info

AnkiDroid Version = 2.10alpha65

Android Version = 9

ACRA UUID = b6b9dbe4-7a2d-4fe1-befa-ba8c24aedfa4

2020-04-11 11:14:46.094 17693-17693/com.ichi2.anki I/BasicImageFieldController: Handle Select Image. Intent: Intent { dat=content://com.google.android.apps.photos.contentprovider/0/1/mediakey:/local[redacted1]/ORIGINAL/NONE/image/jpeg/413092017 flg=0x1 clip={text/uri-list U:content://com.google.android.apps.photos.contentprovider/0/1/mediakey[redacted2]/ORIGINAL/NONE/image%2Fjpeg/413092017} }. extras: null

2020-04-11 11:17:48.552 17693-17693/com.ichi2.anki I/BasicImageFieldController: Decoded image: 'null'

Relevant code: https://github.com/ankidroid/Anki-Android/blob/8ac7e1f8cbdde471e9c6105abbb6266bc4e343e6/AnkiDroid/src/main/java/com/ichi2/anki/multimediacard/fields/BasicImageFieldController.java#L290-L292

Research
  • [x] I have read the support page and am reporting a bug or enhancement request specific to AnkiDroid
  • [x] I have checked the manual and the FAQ and could not find a solution to my issue
  • [x] I have searched for similar existing issues here and on the user forum
Bug Multimedia Reproduced

All 5 comments

Very interesting, my read on it was the shift from file-based I/O to ContentResolver in the Android ecosystem (took place a couple years ago) was almost completely to handle these sort of cloud-based on-demand type files, but that handling them wasn't easy and I'm not surprised we get in to trouble. Hopefully there's some good code out there somewhere that makes it a solved problem and we just need to incorporate the solution

Shouldn't be too hard to fix as it's an issue I can repro, mind if I self-assign?

Will aim to get to it in the next 2 weeks.

No problem by me, I'm at the limit of my bandwidth just doing review+merge+release right now

Linking; #6125 needs this transformation

Fixed in #6125

Was this page helpful?
0 / 5 - 0 ratings