ankidroid / Anki-Android

AnkiDroid: Anki flashcards on Android. Your secret trick to achieve superhuman information retention.
GNU General Public License v3.0
8.71k stars 2.24k forks source link

SVGs are not viewable in the preview window #5306

Closed ohare93 closed 4 years ago

ohare93 commented 5 years ago
Reproduction Steps
  1. Edit a card which has an svg as in image in one of the fields (e.g. <img src="flag.svg" />)
  2. Click the attachment button to the right of the field
  3. You will now be in the "Editing Field" screen since there is an image in the field
Expected Result

A preview of the svg image is shown, just like there is if you open a png this way.

Actual Result

A white square is shown instead.

Debug info

AnkiDroid Version = 2.8.4

Android Version = 9

ACRA UUID = 01229334-5848-488f-afe4-5826790c1bed

Research

Enter an [ x ] character to confirm the points below:

[ 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

These are not svgs from the Image Occlusion plugin.

mikehardy commented 5 years ago

Interesting - Are they viewable during review? Does it work in AnkiDesktop?

ohare93 commented 5 years ago

Yes, and yes.

mikehardy commented 5 years ago

:thinking: - thanks

Anthropos888 commented 5 years ago

Happens in the latest alpha as well. No preview for svgs (blank white screen) in the "editing field" window. JPG and others work fine.

mikehardy commented 5 years ago

I recognize this is asking for something that is probably really easy but it would save time triaging if someone could attach an exported deck with an example card that shows the problem. Can just be one note, and to attach ".apkg" files here you just have to rename them with extension ".zip" (which is coincidentally all an .apkg is...)

Anthropos888 commented 5 years ago

svgTest.zip

1) I realize that might be just a result of Android photo apps (I'm using F-stop amd Google photos) not being able to load svgs.

2) I wonder why AnkiDroid export the test deck with one card and a 20kb svg in a huge size of 9MB??

timrae commented 5 years ago

Probably it has bundled a font or some other kind of static media

On Wed., 15 May 2019, 9:27 am Anthropos888, notifications@github.com wrote:

svgTest.zip https://github.com/ankidroid/Anki-Android/files/3180398/svgTest.zip

1.

I realize that might be just a result of Android photo apps (I'm using F-stop amd Google photos) not being able to load svgs. 2.

I wonder why AnkiDroid export the test deck with one card and a 20kb svg in a huge size of 9MB??

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ankidroid/Anki-Android/issues/5306?email_source=notifications&email_token=AAVQBYRG6AVH6MXISX36CF3PVNKIDA5CNFSM4HM5B4WKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVNFFXI#issuecomment-492458717, or mute the thread https://github.com/notifications/unsubscribe-auth/AAVQBYTAPCE5C7DFH3UHJSDPVNKIDANCNFSM4HM5B4WA .

ohare93 commented 5 years ago

BrokenSVGDeckExport.zip

Here's mine. If it turns out the SVGs are just broken but because of some other program, then that's fine.

valentin-nemcev commented 5 years ago

Interesting - Are they viewable during review? Does it work in AnkiDesktop?

I have the same problem, except its white screen during review too, so this is critical, make image occlusion unusable. AnkiDesktop and AnkiWeb works as expected

AnkiDroid Version = 2.8.4

Android Version = 9

This is an example of SVG

<svg height="743" width="1078" xmlns="http://www.w3.org/2000/svg">
 <!-- Created with Image Occlusion Enhanced -->
 <g>
  <title>Masks</title>
  <rect class="qshape" fill="#FF7E7E" height="86.79245" id="79f6399673b94d1988fedd58f891d425-oa-11" stroke="#2D2D2D" stroke-dasharray="null" stroke-linecap="null" stroke-linejoin="null" width="188.67924" x="108.79239" y="387.18865"/>

 </g>
</svg>
timrae commented 5 years ago

How about ankiweb using chrome on the same Android device that you have AnkiDroid?

On Sun., 26 May 2019, 12:48 am Valentin Nemcev, notifications@github.com wrote:

Interesting - Are they viewable during review? Does it work in AnkiDesktop?

I have the same problem, except its white screen during review too. AnkiDesktop and AnkiWeb works as expected

AnkiDroid Version = 2.8.4

Android Version = 9

This is an example of SVG

Masks

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ankidroid/Anki-Android/issues/5306?email_source=notifications&email_token=AAVQBYW5C2LASJCF3TJMRQDPXFNVFA5CNFSM4HM5B4WKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWHUHDQ#issuecomment-495928206, or mute the thread https://github.com/notifications/unsubscribe-auth/AAVQBYX6O6FTTCPNFNEGTP3PXFNVFANCNFSM4HM5B4WA .

mikehardy commented 5 years ago

5332 possibly related

github-actions[bot] commented 4 years ago

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