Image Relinker

by key
5
4
3
2
1
Score: 50/100

Description

Repair broken image embeds in the active Obsidian note.

Reviews

No reviews yet.

Stats

0
stars
280
downloads
0
forks
25
days
5
days
5
days
0
total PRs
0
open PRs
0
closed PRs
0
merged PRs
0
total issues
0
open issues
0
closed issues
37
commits

Latest Version

5 days ago

Changelog

Image Relinker 0.1.4

Improved repair modal

  • Repair-range and attachment-folder controls are vertically centered in their settings rows.
  • The two repair steps are now always clickable: ① 扫描并预览 and ② 应用修复.
  • When an action cannot proceed, the plugin now explains what is missing instead of disabling the button.
  • Every image record now shows a thumbnail, filename/link details, and a color-coded status badge.
  • The apply-repairs button now uses Obsidian's primary purple accent.

使用提示

先点击“① 扫描并预览”,确认结果后点击“② 应用修复”。如果缺少附件目录、尚未扫描或没有可修复项,插件会给出提示。

README file from

Github

Hi there 👋 I'm keyoneway No‑code builder empowered by AI. Explore possibilities, build practical tools, and create real value in the AI era.

AI赋能的零代码创造者|探索更多可能,打造实用工具,在AI时代创造真实价值


  • image‑relinker|Obsidian断图链接修复小工具,一键批量修复笔记中失效的图片引用

English  中文说明

Image Relinker

Preview and repair broken image embeds in the active note or every Markdown note in a selected folder, using unique filename matches from a selected attachment folder.

Features

  • Scans image embeds in the active Markdown note or all Markdown notes in a selected folder (including subfolders).
  • Lets you select the attachment folder to search.
  • Adds a Ribbon entry alongside Command Palette and file-menu access.
  • Previews grouped repairs before changing any note.
  • Updates only unique file‑name matches; missing and ambiguous matches are left unchanged.

Install

In Obsidian, open Settings → Community plugins → Browse, search for Image Relinker, install it, and enable it.

Use

  1. Click the Image Relinker Ribbon icon, run the command from Ctrl+P, or right-click a Markdown file.
  2. Choose Current note to repair one note, or Notes in folder to process all Markdown notes in a selected folder and its subfolders.
  3. Select the attachment folder containing the image files.
  4. Scan, review the grouped preview, and apply the safe repairs.

Folder mode never writes automatically: only unique filename matches are repairable; missing and ambiguous matches are left unchanged.

Development

npm install
npm test
npm run check
npm run build

中文说明

适用场景

当 Markdown 笔记从桌面或其他位置复制到 Obsidian Vault 后,原图片链接可能会失效。例如,笔记中的图片原本位于桌面文件夹,后来图片被统一放入 Vault 的 90‑Attachments 文件夹。本插件会在你选定的附件目录中按文件名寻找图片,并将当前笔记中的失效图片链接替换为 Obsidian 可识别的嵌入链接。

使用方法

  1. 将图片复制到 Vault 内的附件目录,例如 90‑Attachments。
  2. 打开需要修复的 Markdown 笔记。
  3. 按 Ctrl+P 打开命令面板,运行 Image Relinker: 修复当前笔记图片.
  4. 在弹窗中选择保存图片的附件目录;默认会读取 Obsidian 的附件目录设置。
  5. 点击 "扫描并预览",检查 "可修复" 列表。
  6. 确认无误后,点击 "应用修复".
文件夹批量修复
  1. 点击左侧功能区的 Image Relinker 图片图标;也可通过命令面板或 Markdown 文件右键菜单打开。
  2. 将修复范围切换为「笔记文件夹」,选择需要处理的文章文件夹和图片附件目录。
  3. 点击「扫描并预览」;插件会递归扫描该文件夹内的全部 Markdown 笔记,并按笔记分组展示结果。
  4. 仅在确认预览后点击「应用修复」。扫描后被手动改动的笔记会被跳过,不会覆盖内容。

安全规则

  • 仅修改当前笔记或你明确选择的笔记文件夹内的笔记,不会移动、删除或重命名图片文件。
  • 只有当所选目录内存在唯一同名图片时才会自动修复。
  • 找不到文件或存在多个同名文件时,插件不会修改该链接。
  • 扫描阶段不会改动笔记;只有点击 "应用修复" 后才会写入。

无法自动修复时

请确认图片已放入你选择的附件目录,且文件名与笔记中的链接文件名一致。若目录中有多个同名图片,请保留唯一的目标文件或手动修改链接后重新扫描。

License

MIT