GnoxNahte / obsidian-auto-embed

Obsidian plugin to embed websites using simple markdown instead of iframe
MIT License
18 stars 0 forks source link

[BUG]: Images converted to iframes when add/resize in tables #5

Closed Rikiub closed 3 months ago

Rikiub commented 3 months ago

This table looks normal.

image

But when add/remove columns or change the size of the images, there is converted on:

image

Don't happens in Live Preview, but only in Reading View.

Only is fixed when I refresh the note page.

GnoxNahte commented 3 months ago

Hi thanks for the bug report but I can't reproduce the issue.

On Update 1.0.6 (https://github.com/GnoxNahte/obsidian-auto-embed/commit/ad30a9b3027b13c9e13a5d6419e960a7f6f29813), I removed embedding web images (links ending with an image extension like .png, .jpg, etc). It should use Obsidian's Embed Image for embedding web and local images.

Here's a video of me trying it: The image web link from the video: https://publish-01.obsidian.md/access/f786db9fac45774fa4f0d8112e232d67/Attachments/Engelbart.jpg The TikTok just shows the plugin is installed and enabled.

https://github.com/user-attachments/assets/20bd7c5a-e221-4de1-855c-c24f927edd5f

There are some image links that the plugin can't automatically size though. For example, the plugin doesn't know the size of the embed for image that u sent here in GitHub. The link doesn't end with an image extension so Obsidian isn't embedding it. So my plugin tries to embed it but the sizing is probably done on GitHub's side. If you aren't sure about this I can write a better explanation later.

If you aren't sure, try sending the image link here and I'll see if it can be embedded and sized correctly.

Rikiub commented 3 months ago

Hello! Thank you for your quick responses!

Yeah, the issue don't happens with external images, but only with local images.


I recorded a video to explain the issue:

https://github.com/user-attachments/assets/e72fc988-c155-466f-b177-245618bc6406

GnoxNahte commented 3 months ago

Hmm I have no idea why Obsidian's doing that. Trying it on my side, local images resize correctly. If it's too big, the whole table will be scrollable. Not just the image.

Here's what shows up for mine. You can see the scrollbar at the bottom. image

By the way, this plugin doesn't do anything to local images. The syntax you used is also different from the plugin's syntax too. Obsidian's method of embedding local images is ![[image link]] while mine is![](url). To confirm, you can try disabling the plugin, reloading Obsidian, and trying it again? If it still doesn't fix it, you can try disabling your other plugins. Or try creating a sandbox vault and test there.

Rikiub commented 3 months ago

The table scroll bar does not matter. When I add an image to a table, instead of embed a simple image, it becomes an "iframe" generated by "auto embed". You can see it, since below the "iframe" it shows the link to the image:

Obsidian_FtFYZtCliu

Is weird because only happens in tables and only in reading view.

I tested it in a sandbox vault with only the plugin enabled and I can reproduce the issue, like the video.

GnoxNahte commented 3 months ago

Oh I'm able to reproduce it! Sorry I didn't read that it happens only in reading view in your first message. I'll fix it and push an update soon.

Thanks for the bug report and clarifying it with me!

GnoxNahte commented 3 months ago

Fixed it in version 1.1.2! Hopefully it's fixed. Keep the bug reports & feature requests coming! Would like to improve the plugin more.

Rikiub commented 3 months ago

Oh I'm able to reproduce it! Sorry I didn't read that it happens only in reading view in your first message. I'll fix it and push an update soon.

Thanks for the bug report and clarifying it with me!

Don't worry! At less you noticed about it and wow, you did it so fast, I'm glad for your motivation! I really wish more people knew about this plugin!