typora / typora-issues

Bugs, suggestions or free discussions about the minimal markdown editor — Typora
https://typora.io
1.53k stars 58 forks source link

copy image to local sometimes cannot work #4525

Closed qigtang closed 3 years ago

qigtang commented 3 years ago

Describe the bug In the preference setting, if I select "copy image to ./${filename}.assets", select online image and then copy most of time will work, but find some scenarios it cannot work. Please see reproduce step.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://mp.weixin.qq.com/s/vDPYwzHRok6KFtYumMsa7g
  2. copy the first image there, right mouse button, copy image, paste into one typora document, you will get

https://mmbiz.qpic.cn/mmbiz_png/xBVu2dcQn9xfI3GrojZdk5II3mQTnq87GHyQ7ejYkvZhSkibDEWVsGShMIUOKYiafcZsahWn2bM72FY3YebS6Gaw/640?wx_fmt=png&tp=webp&wxfrom=5&wx_lazy=1&wx_co=1

  1. after that, "copying image" will be spinning for a while, but no image will be copied into assets folder.
  2. Expected behavior Should be able to copy it.

Screenshots / Screencasts image

Sample Markdown File not applicable.

Desktop (please complete the following information): windows 10 64bit

Typora Version e.g: 0.11.0

Additional context Another suggestion regarding image naming. sorry I forgot the website that causing the trouble. If in a website, several images have the same basename, but different path, typora will copy it using the same basename, that means new copied image will overwrite old images, even if they are different images in original website. Suggestion: when copying images from website, maybe it is better to use sha1 hash of the contents of images as local file name, instead of original file name.

abnerlee commented 3 years ago

should be fixed in 0.11.2

qigtang commented 3 years ago

Great job! I tested with the case above, and confirm it is fixed.

Noticed one minor issue/difference:

image

In preference, I already set "copy to local", but in typora, when I copy image, the new version will give me 3 options to choose.

image

Which means either move mouse to pick one option, or "down" key, press "enter". which will grab some attention from user, and have a minor impact on workflow.

Suggestion: