SlRvb / Obsidian--ITS-Theme

Theme designed with readability and customizability in mind. Change it easily to your liking with the Style Settings plugin installed.
https://publish.obsidian.md/slrvb-docs/ITS+Theme/ITS+Theme
GNU General Public License v2.0
555 stars 114 forks source link

Image is not resized in preview pane #182

Closed Missionary-OSBS closed 1 year ago

Missionary-OSBS commented 1 year ago

Describe the bug

The image is not resized in preview pane

Expected behavior The image should be resized in preview pane

To Reproduce

Steps to reproduce the behavior:

  1. Embed an image. E.g. ![[Frosthaven.png|100]]
  2. Preview a file with the image
  3. See error: the image is not resized to 100 but it retains its original size

Screenshots

OS

Where does the bug occur?

Obsidian Version: V1.1.15

SlRvb commented 1 year ago

Preview pane? Do you mean Popover or do you mean Reading view?

Missionary-OSBS commented 1 year ago

I mean Popover.

FireIsGood commented 1 year ago

Seems to be the .popover.hover-popover img:not([alt=""]):not(.cm-widgetBuffer):not(.emoji):not(.link-favicon) selector which doesn't account for images with the built-in image dimensions. This can be fixed by adding :not([width]) to the popover class.

FireIsGood commented 1 year ago

Ah, a better solution would be to remove the width: 100% declaration to cap out overly wide widths (e.g. width of 800px would overflow in the previous solution idea) but allow for the desired smaller width images.

I'll put up a pull request to fix it.

SlRvb commented 1 year ago

This should now definitely be fixed in the beta.