ankidroid / ankidroid/Anki-Android

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

Đang mở
#19,679 11 bình luận 0 reaction 1 người được giao Được @mikehardy-machineaccount nhận Xem trên GitHub
2.22 2.23 upstream-issue
Ngôn ngữ chính
Kotlin
Star
11.8k
Fork
2.9k
Merge trung bình
2 ngày 3 giờ
Pull request đã merge (30 ngày)
171

Mô tả

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))

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.