Canvas not rending scaled image, and not scaling large image in edit mode

Steps to reproduce

Issue 1: Scaled image doesn’t render in canvas view mode

Take a large image, embed in a note with
![[image.png|0x128]]
to limit the height to 128px

Observe in the note the image scales correctly
image

Goto canvas
Add the card to the canvas
Notice the image doesn’t render
image

If you click on the note in the canvas to jump into edit mode, the image will re-appear.
image

A work-around that does render properly in the canvas is
<img src="file:///path/to/image.png" style="height:128px;">
or with style="max-height:128px;"

Issue 2: no scaling in edit mode

Take a large image, embed in a note
![[image.png]]

Put the note in a canvas and re-size the card so it is bigger than the image.
Notice the full image is shown without scaling

Now drag the size of the card to be smaller and watch the image scale to fit within the card size
image

Now click inside the card to enter edit mode

image

Observe that the image is blown up and is not scaling in edit mode down to within the bounds of the edit area.

Expected result

Problem 1:

We should see the image rendered

Problem 2:

We should see the image scaled correctly in edit mode

Actual result

Problem 1:

We do not see the image rendered

Problem 2:

We do not see the image scaled correctly in edit mode

Environment

  • Operating system: Linux
  • Debug info:
    SYSTEM INFO:
    Obsidian version: v1.1.9
    Installer version: v1.1.9
    Operating system: #1 SMP Fri, 03 Feb 2023 20:22:45 +0000 5.15.91-4-lts
    Login status: not logged in
    Insider build toggle: off
    Live preview: on
    Legacy editor: off
    Base theme: dark
    Community theme: none
    Snippets enabled: 0
    Restricted mode: on

RECOMMENDATIONS:
none

We don’t support this. This accidentally works sometimes. Open a feature request to support 0x...

OK I can do that.

I will open a separate bug report for “Issue 2: no scaling in edit mode”.
Sorry I lumped two issues into one, the 2nd issue I included is independent of the 0x feature.