-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image not showing in study options menu. #6669
Comments
For those that aren't sure where this is (it is a screen not seen often in some AnkiDroid configurations) this will show up if you tap the new/due etc numbers on the right side of the deck list screen for a deck, or if you are in "tablet" mode where the main activity goes split screen, at which point it's visible on the right side |
This isn't currently a WebView, we'll need to switch implementations to handle any complex cases.
|
Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically |
I am working on it |
It's not showing any square on that screen, can anyone help me with that? |
This contain sample deck. Import it in AnkiDroid and click on far right (new, learn, review number) on deck name.
Extract sample.apkg, import and view |
@infinyte7 thanks for the input |
I would like to work on this issue. |
@Abanoub-Asaad go for it! |
is this issue is free now? |
@Ghanem21 |
I can help with this by solving the image preview issues. |
IIRC recent desktop versions don't support this either. |
@dae said:
They do, just tested this with Can you please reopen this issue? This would really deserve to be solved on AnkiDroid as well, because quite a few cool features depend on it. For example, I use it to notify my users whether an update/patch of my decks is available: Also, this has the "Keep open" tag, so I don't understand why it was closed. Thanks. |
Sorry, I remembered incorrectly. Images are disabled if you have markdown enabled, but that may change in the future. |
Thank you for your answer any reopening this. Please, don't disable this feature in the desktop version as well. It makes no sense, when remote images are allowed on cards and removing the support for them on cards as well (to make the "privacy and tracing" concerns valid) would make a lot of people mad. There's a way to go around this restriction (for this "update notification" feature) by adding a card to the deck, which will load the remote image with the current update status and then prompt the user to bury it, but it just makes it harder for everyone (plus, let's be honest, most Anki users are causals who don't even know what "Bury card" even means). |
I would like to say, it's an excellent and important feature, and @ShadyMedic has ingeniously utilized it. I definitely need this feature! DesktopVersion 2.1.65 (aa9a734f) deck's info pageworks great on deck's info page card viewThe image resources are not rendered and displayed in the card view. I haven't used the devtool to check yet. AnkiDroidAnkiDroid Version = 2.18alpha6-debug (a854e93) deck's info pageHow to set up a test deck with url img?The UI and sequence shown in the gif below have become deprecated. Type Resource Loading Policy: CORS? Path Issues: base64? downloaded locally and then loaded into the WebView from a local path? Permission Issues: user need give permissions to folder/resources. WebView Configuration Issues: WebView configuration that prohibit image loading. Image Format,Network Issues etc. This does not apply to this issue. |
@wyy511511 Hi there, thank you for your support. The reason why you don't see the image in the card on desktop is because Anki parses the card fields on order to display exactly what you typed in (which is desirable most of the time). In order to make the HTML code render an image, you need to paste it into the code editor (you can enable it by clicking the About deck description in AnkiDroid, I looked into the code some time ago and although I don't umderstand mobile app development all that much, it seemed to me like the deck description is not actually being rendered by WebView and there is an parser function in the code somewhere, which reformats certain HTML elements to better fit the app and override user-defined CSS (for example, by removing borders and background colors). Remote images are disabled at this step as well, I think. |
@wyy511511 Thank you very much for the reproduction step. |
Hi @david-allison, In my commit 9a70640, I've tried that switching to a WebView can solve this problem. However, based on your response, I'm curious whether you'd prefer solving it by customizing the TextView and using Html.ImageGetter instead. If AnkiDroid is okay with switching to WebView, I think the related test code also needs to be modified. TextView related test codeI'm not familiar with the testing part yet, so I'm hesitant to make changes directly. If needed, I'd be happy to work on the testing part. |
Test deck apkg |
We should aim to follow Anki Desktop's current implementation. First investigate what this is, especially the security procedures taken. This may have changed in the past 4 years Regarding tests, feel free to leave |
I reviewed Anki Desktop's implementation , where the original tag within the
_desc() function(this includes a branch to support markdown). The generated HTML string is then integrated into the Overview page's content and displayed in a WebView (i.e., self.web) through the self.web.stdHtml method.
I'll update tests. I am checking
|
I tested Anki Desktop still allow js. |
Is the issue resolved now? I should be able to help with my android development knowledge. |
No, the issue still persists. It would be awesome if you could fix it.
7. 8. 2024 7:21:57 Abhijeet Shashwat ***@***.***>:
…
Is the issue resolved now? I should be able to help with my android development knowledge.
—
Reply to this email directly, view it on GitHub[#6669 (comment)], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AEXY767EVNMQVN5NEWHLO5DZQGVHHAVCNFSM4OYF73J2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMRXGI3DIMBRGU3A].
You are receiving this because you were mentioned.
[Sledovací obrázek][https://github.com/notifications/beacon/AEXY764TAWWU4Q2JQ6I3NLLZQGVHHA5CNFSM4OYF73J2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOQ523ZHA.gif]
|
I believe the point is that webview will lead to MANY potential SECURITY issues, so it is not suitable for modifying the existing implementation that only supports textfield. I implemented the requested feature in my clone repo ( https://github.com/wyy511511/Anki-Android ) |
That doesn't make sense though, since external images are already allowed on the cards and as far as I know, JavaScript works as well.
And I am not aware of any security incidend that this has caused. So if this was allowed in deck descriptions as well (that many users don't even see because they go straight to browsing the cards), it wouldn't worsen the security of the app in any way.
7. 8. 2024 9:34:11 Yaoyao ***@***.***>:
…
I believe the point is that webview will lead to MANY potential SECURITY issues, so it is not suitable for modifying the existing implementation that only supports textfield.
—
Reply to this email directly, view it on GitHub[#6669 (comment)], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AEXY76Z7HKR6HWDUYWR73ODZQHEXDAVCNFSM4OYF73J2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMRXGI4DCNBTGQZQ].
You are receiving this because you were mentioned.
|
Reproduction Steps
Expected Result
It should show images.
Actual Result
It is not showing image.
In Anki Desktop it is showing images. But in AnkiDroid showing small square.
AnkiDesktop
AnkiDroid
Debug info
AnkiDroid 2.12beta5
Research
Enter an [x] character to confirm the points below:
The text was updated successfully, but these errors were encountered: