Local images ("Pasted image ...") not found during PDF export
What we experienced
Embedded local images (e.g. Obsidian's default pasted-screenshot naming) failed to export, even though the file genuinely existed in the vault. This came in two stages as we dug in:
First, exports silently dropped the image and inserted a placeholder like [⚠️ Image not found: <filename>] in the output.
After a plugin patch (see below), the image was found, but the Typst compile step then failed with a "file not found" error, where the searched-for path looked like the vault path with a system temp directory oddly appended to it (something resembling <vault path>/<OS temp dir>/media-<hash>/<attachment folder>/<filename>).
What we think is happening
Stage 1: processImageEmbeds calls resolveLocalPath(...) with the "use Obsidian's metadataCache.getFirstLinkpathDest" flag hardcoded to false — unlike the PDF-embed and generic-file-embed code paths, which both pass true. This means image resolution only checks a literal attachments folder plus a couple of fixed relative paths, and never respects a vault's actual configured attachment folder or Obsidian's own link resolution.
Stage 2: once images resolve correctly, Pandoc appears to stage the referenced image through a system temp directory before invoking Typst. Since Typst treats any path starting with / as root-relative rather than OS-absolute (a deliberate sandboxing behavior), and no --root is ever passed to the Typst engine invocation, Typst ends up prepending its default root onto an already-absolute path — producing the doubled, malformed path in the error.
What we tried (worked, at least for our setup)
Flipped the hardcoded false to true in the resolveLocalPath call inside processImageEmbeds, so it uses the same link-resolution logic already used for PDF/file embeds.
Added --pdf-engine-opt=--root=/ to the Typst invocation in buildPandocArgs, so absolute-looking paths resolve as real filesystem paths instead of being treated as root-relative.
Both were quick local patches to the compiled main.js, not proper PRs — happy to share diffs if useful, but flagging this mainly so it's on the radar. We're not fully confident --root=/ is the right long-term fix (vs. controlling where Pandoc stages media, or avoiding staging altogether) — just what got us unblocked.
Possible solutions
Pass the same link-resolution flag (true) for image embeds as is already used for PDF/file embeds.
Either avoid Pandoc's temp media staging entirely for local images, or explicitly set Typst's --root to match wherever staging happens.
## Local images ("Pasted image ...") not found during PDF export
**What we experienced**
Embedded local images (e.g. Obsidian's default pasted-screenshot naming) failed to export, even though the file genuinely existed in the vault. This came in two stages as we dug in:
1. First, exports silently dropped the image and inserted a placeholder like `[⚠️ Image not found: <filename>]` in the output.
2. After a plugin patch (see below), the image was *found*, but the Typst compile step then failed with a "file not found" error, where the searched-for path looked like the vault path with a system temp directory oddly appended to it (something resembling `<vault path>/<OS temp dir>/media-<hash>/<attachment folder>/<filename>`).
**What we think is happening**
- Stage 1: `processImageEmbeds` calls `resolveLocalPath(...)` with the "use Obsidian's `metadataCache.getFirstLinkpathDest`" flag hardcoded to `false` — unlike the PDF-embed and generic-file-embed code paths, which both pass `true`. This means image resolution only checks a literal `attachments` folder plus a couple of fixed relative paths, and never respects a vault's actual configured attachment folder or Obsidian's own link resolution.
- Stage 2: once images resolve correctly, Pandoc appears to stage the referenced image through a system temp directory before invoking Typst. Since Typst treats any path starting with `/` as root-relative rather than OS-absolute (a deliberate sandboxing behavior), and no `--root` is ever passed to the Typst engine invocation, Typst ends up prepending its default root onto an already-absolute path — producing the doubled, malformed path in the error.
**What we tried (worked, at least for our setup)**
- Flipped the hardcoded `false` to `true` in the `resolveLocalPath` call inside `processImageEmbeds`, so it uses the same link-resolution logic already used for PDF/file embeds.
- Added `--pdf-engine-opt=--root=/` to the Typst invocation in `buildPandocArgs`, so absolute-looking paths resolve as real filesystem paths instead of being treated as root-relative.
Both were quick local patches to the compiled `main.js`, not proper PRs — happy to share diffs if useful, but flagging this mainly so it's on the radar. We're not fully confident `--root=/` is the right long-term fix (vs. controlling where Pandoc stages media, or avoiding staging altogether) — just what got us unblocked.
**Possible solutions**
- Pass the same link-resolution flag (`true`) for image embeds as is already used for PDF/file embeds.
- Either avoid Pandoc's temp media staging entirely for local images, or explicitly set Typst's `--root` to match wherever staging happens.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Local images ("Pasted image ...") not found during PDF export
What we experienced
Embedded local images (e.g. Obsidian's default pasted-screenshot naming) failed to export, even though the file genuinely existed in the vault. This came in two stages as we dug in:
[⚠️ Image not found: <filename>]in the output.<vault path>/<OS temp dir>/media-<hash>/<attachment folder>/<filename>).What we think is happening
processImageEmbedscallsresolveLocalPath(...)with the "use Obsidian'smetadataCache.getFirstLinkpathDest" flag hardcoded tofalse— unlike the PDF-embed and generic-file-embed code paths, which both passtrue. This means image resolution only checks a literalattachmentsfolder plus a couple of fixed relative paths, and never respects a vault's actual configured attachment folder or Obsidian's own link resolution./as root-relative rather than OS-absolute (a deliberate sandboxing behavior), and no--rootis ever passed to the Typst engine invocation, Typst ends up prepending its default root onto an already-absolute path — producing the doubled, malformed path in the error.What we tried (worked, at least for our setup)
falsetotruein theresolveLocalPathcall insideprocessImageEmbeds, so it uses the same link-resolution logic already used for PDF/file embeds.--pdf-engine-opt=--root=/to the Typst invocation inbuildPandocArgs, so absolute-looking paths resolve as real filesystem paths instead of being treated as root-relative.Both were quick local patches to the compiled
main.js, not proper PRs — happy to share diffs if useful, but flagging this mainly so it's on the radar. We're not fully confident--root=/is the right long-term fix (vs. controlling where Pandoc stages media, or avoiding staging altogether) — just what got us unblocked.Possible solutions
true) for image embeds as is already used for PDF/file embeds.--rootto match wherever staging happens.