ankidroid / ankidroid/Anki-Android

Pasting an image into a field in the "Notes" tab of the Image Occlusion editor inserts the image as base64

オープン
#19,679 コメント 11 件 リアクション 0 件 担当者 1 名 @mikehardy-machineaccount が担当を希望しています GitHub で見る
2.22 2.23 upstream-issue
主要言語
Kotlin
スター
11.8k
フォーク
2.9k
平均マージ
2日 3時間
マージ済み PR(30日)
171

説明

https://github.com/ankidroid/Anki-Android/labels/upstream-issue
* https://github.com/ankitects/anki/issues/4457

----

### Checked for duplicates?

- [x] This issue is not a duplicate

### Does it also happen in the desktop version?

- [ ] This bug does not occur in the latest version of Anki Desktop

### What are the steps to reproduce this bug?

1. Insert image to Android clipboard. Some gallery apps in Android have a button called "Copy image to clipboard".
2. Paste the image to a field that is shown in the tab "Notes" of the Image Occlusion editor.
3. Save changes
4. Open window Decks
5. Open Card browser
6. Tap on the image where you pasted the image
+ At this point, AnkiDroid will take considerable time to show the screen that has the button "Edit Occlusions"

The videos below demonstrate this behavior. All of the videos in this section were recorded in 2.23.0beta4.

In the video below, I create a sample Image Occlusion note. No bug happened.

https://github.com/user-attachments/assets/4f2f405a-e251-4554-ac1d-e9966de78fd4

In the video below, I paste an image to a field that is shown in the tab "Notes" of the Image Occlusion editor. It seems that no bug occurred, but at this point the image has already been stored as base 64 in the field.

https://github.com/user-attachments/assets/3d7148aa-bc84-4e86-b718-5438db78acd0

In the video below, I edit the note where I pasted the image. It took more than 20 seconds to for AnkiDroid to show the window that shows the "Edit Occlusions". I guess this happens because this note has a field with lots of content: the image encoded in base 64.

https://github.com/user-attachments/assets/ade9c169-cd06-477c-b985-6447d7ab46b9

### Expected behaviour

The image should be inserted as a path instead (behavior in AnkiDroid 2.22.3) instead of being inserted as base64.

The video below shows the behavior when pasting an image in a field of an Image Occlusion note in AnkiDroid 2.22.3. I believe that this should be the behavior in AnkiDroid 2.23.0.

https://github.com/user-attachments/assets/9c291880-c821-4368-9bf9-e688f43bb942

### Debug info

```text
AnkiDroid Version = 2.23.0beta4 (367917ada802088c982a8ce11312fbb35d4290c3)
Backend Version = 0.1.62-anki25.09.2 (25.09.2 3890e12c9e48c028c3f12aa58cb64bd9f8895e30)
Android Version = 15 (SDK 35)
ProductFlavor = full
Device Info = samsung | samsung | gta4xlswifi | gta4xlswifixx | SM-P620 | s5e8825
Webview User Agent = Mozilla/5.0 (Linux; Android 15; SM-P620 Build/AP3A.240905.015.A2; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/142.0.7444.102 Safari/537.36
ACRA UUID = a32527bb-1a56-4c2f-92a8-65ce53ea03ff
FSRS = 5.1.0 (Enabled: false)
Crash Reports Enabled = true
```

### (Optional) Anything else you want to share?

I can confirm that the image is stored in base 64 because I installed Anki 2.22.3 and visited the Anki data directory that contained the note which I created using 2.23.0beta4.

![Image](https://github.com/user-attachments/assets/1e8bfb9e-1c11-45e8-9681-50b1f2f78bc5)

https://upload.wikimedia.org/wikipedia/commons/1/1b/Using_AnkiDroid_2.22.3_to_view_a_note_created_by_AnkiDroid_2.23.0beta4.webm

### Research

- [x] I have checked the [manual](https://ankidroid.org/docs/manual.html) and the [FAQ](https://github.com/ankidroid/Anki-Android/wiki/FAQ) and could not find a solution to my issue
- [ ] (Optional) I have confirmed the issue is not resolved in the latest alpha release ([instructions](https://docs.ankidroid.org/manual.html#betaTesting))

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。