Skip to content
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

Cannot preview image defined by huge base64 string #6057

Open
3 tasks done
hsandt opened this issue May 18, 2024 · 0 comments
Open
3 tasks done

Cannot preview image defined by huge base64 string #6057

hsandt opened this issue May 18, 2024 · 0 comments

Comments

@hsandt
Copy link

hsandt commented May 18, 2024

  • Searched existing issues to avoid creating duplicates.

  • Confirmed that it can be reproduced in built-in themes without customized css.

    If it only exists in 3rd party themes or css, you can still report it, but please attach the theme target or the css file. We may not "fix" it, if it is caused by 3rd party themes or css styles that we cannot support.

  • Searched http://support.typora.io/


Describe the bug
Typora stops previewing base64 images (e.g. from standalone HTML exports) when the strings get too long (that happens with a combination of a picture of big dimensions and a lot of details on the picture)

Here is the sample image I used:
sample_image_1600x1000

If you're knowledgeable in base64 conversion you can do it yourself (personally I use base64 sample_image_1600x1000.png | xclip -selection clipboard on Linux), but I prepared a .md file so it's easier to just download it, see Sample Markdown File more below.

To Reproduce
Steps to reproduce the behavior:

  1. Open the Sample Markdown File
  2. See how the base64 string ![img](data:image/png;filename=red_square.png;base64,iVBO...) is displayed as raw text, no image preview

Expected behavior
Big pictures should be previewed, or, if Typora has a safeguard to avoid overflow exploits or app freeze, it should at least display a warning, either locally near the base64 string, or at the top right after pasting, using the existing warning system:

image

(taken from #4869)

Screenshots / Screencasts
image

Sample Markdown File
base64 huge string demo.md

Desktop (please complete the following information):

  • OS: Linux Ubuntu 22.04

Typora Version
1.7.6

Additional context
I'm working with a lot of charts and one of them was very big, although the image very complex. The sample image I put represents that.

A pure red rectangle of 1600x1000 won't have the issue so I have to add colored details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant