obsidian-paste-image-rename
obsidian-paste-image-rename copied to clipboard
Paste image, the file will be rename, but the name in .md is still the original one.
Describe the bug Paste image, the file will be rename, but the name in .md is still the original one.
Environments (please complete the following information):
- OS: Win10
- Use markdown format
- Debug info: no "show debug info" in my command ...
To Reproduce Steps to reproduce the behavior:
- Ctrl+C the file or screenshot captured in picpick.
- Paster in OB. The log will show "rename to xxx(md file title).jpg/png
- Confirm the image file has been copy to the attachment folder and rename to xxx.jpg/png
- But in md, the link is still pointing to the original file name before renaming.
Screenshots
**Feature request We I paste image from screenshot tool or web browser, the format is .PNG, the file size is large, is it possible to add a function to convert it to .jpg automatically? There is a plugin called"paster image png to jepg", but its rename functon is not very powerful...
Thank you for your great job!
Hello. I confirm the same behavior, file is renamed, but the pasted description to the markdown file is not changed. Obsidian: v0.14.15 OS: macOS 12.1.
I confirm the same behavior too!!! File is renamed, but the pasted description to the markdown file is not changed!!!!!!!!!!! Obsidian: v0.14.16 OS: macOS11.6.6
And it work some time, it not work some time, so fuck.
Same issue here. Looks like a race condition of some sort.
Looks like a race condition of some sort.
Also experiencing this. Seems to only happen sometimes, so this would make sense.
Same issue here Obsidian: v0.15.8 OS: win11
Same issue here.
我也遇到了这个情况,并且提供了录屏证据
These should be the same questions:
Duplicate of #24 Duplicate of #20 Duplicate of #13 Duplicate of #11
These should be the same questions:
Duplicate of #24 Duplicate of #20 Duplicate of #13 Duplicate of #11
OK If disabling auto rename the link is changed. When the rename window pops up, wait a moment and then confirm will modify the links in the file.
I think the problem arises here:
https://github.com/reorx/obsidian-paste-image-rename/blob/caf25cf58e04ea2f7206bd389dccedb8a6e12670/src/main.ts#L179-L182
Why I can't see the log in the console?
I try the DEBUG is true:
我重新启动软件几次后,又能够正常使用了
Will it still be updated?
还继续开发更新吗??
To @jerviscui @lxq1 and all whom it may concern, I'm busy preparing for an exam recently and am not available to review the issues, so sorry for getting you into trouble while using this plugin. The exam ends on the 16th of November, after that I'll get back to dive into the problem ASAP.
It doesn't work properly in Obsidian 1.1.9 either.
@reorx Any update? I love the plugin, just this not working makes things not really helpful.
I can reproduce the issue only when hitting "rename" very fast. If I wait 2-3s before clicking rename, all goes well.
To Reproduce:
- Switch off
Use [[WikiLinks]]
, - Create a new note named:
Untitled
, note filename contains a space char. - Paste an image
- Link text under cursor should be

- Dive into main.js:
-
const originStem = file.basename; // HERE WILL BE 'Pasted image 20221229124433.png'
-
linkTextRegex = new RegExp("!\\[\\]\\(([^[\\]]*\\/)?${originStem}\\.${ext}\\)");
-
Pasted image 20221229124433.png
not matchesPasted%20image%2020221229124433.png
-
- Link text under cursor should be
-
Auto rename
switched ON, link text not replaced. -
Auto rename
switched OFF, Click theRename
button on modal, link text not replaced.
测试了一下只OB 1.19 只在打开WIKI语法时正常生效, 关闭WIKI语法则出现这个问题, 源码逻辑应该是有问题
Hey guys, this issue should be fixed in 1.6.0, please update and try if it works. You can also look at the release log, which contains more details and my sincere gratitude to you.