Skip to content

[BUG] Cannot resize attached images whatsoever. Does not respect both obsidian's format and zennote's #570

Closed

Description

@corpserot

ZenNotes v2.26.0

I tried this, following suggested excalidraw format

![[assets/cognitive_web.jpg|100x50]]

I tried this, following obsidian's format

![cognitive web|100x50](../../assets/cognitive_web.jpg)

both resulted in this, showing that zennotes does not respect specified image size constraints when displayed both in editor and preview (not shown, cuz it's the same thing).

Image

i cannot select text in help, you can read it yourself in the source code about what your LLM wrote in regards to image (and excalidraw) sizes. (btw, that file looks horrible... definitely shaking my faith in LLM discipline used in this project)

Activity

  1. adibhanna commented on Aug 10, 2026

    @adibhanna
    Contributor

    You are right, and the help was writing checks the renderer never cashed: size hints were documented as "same syntax as images" but only Excalidraw embeds ever honored them. Plain images ignored the hint entirely and leaked it into the alt text, in both spellings you tried.

    Fixed in 302a5ff on the v2.27.0 branch. Both of your exact lines now work:

    • ![[assets/cognitive_web.jpg|100x50]] renders at 100x50, and ![[assets/pic.png|300]] sets width with height following the aspect ratio.
    • ![cognitive web|100x50](../../assets/cognitive_web.jpg) renders at 100x50 and keeps "cognitive web" as the caption. Pipes inside a caption survive; only a trailing segment that parses as a size is consumed.
    • Applies in the editor's live preview, the reading view, and the PDF export path (same renderer). A hint wider than the pane is still capped by the layout's max-width.

    Worth admitting: the first attempt at this fix set the width/height attributes and looked correct in the HTML while the pixels on screen did not move, because the embed stylesheet stretches images to the pane width and attributes lose to CSS. Measuring the rendered size in the running app caught it; the hint now also lands as inline style. The verification run uses your exact two lines and asserts getBoundingClientRect comes back 100x50 in both Edit and Preview.

    How to test locally once it ships (or from the branch): drop an image in assets/, add both lines from your report to a note, and check Edit and Preview. Before: two full-width images with the hint in the alt text. After: both at 100x50.

    The non-selectable help text is a fair separate gripe; it is on the list. Ships in 2.27.0.

  2. adibhanna commented on Aug 10, 2026

    @adibhanna
    Contributor

    Closing as fixed by 302a5ff on the v2.27.0 branch; ships with 2.27.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions