decaf-dev / obsidian-vault-explorer

Explore your Obsidian vault in visual format
https://vaultexplorer.com
MIT License
110 stars 4 forks source link

Hide the broken image if the plugin failed to get the social media image #331

Open Moyf opened 2 months ago

Moyf commented 2 months ago

Some web would reject the request for image (403), and there would be a broken image icon: image

In the DevTool: image

So, could you consider ignore the "bad image" if the response fails?


BTW, v1.42.0 is a huge update! Really love it, good job!

decaf-dev commented 2 months ago

@Moyf Sorry for the hiatus. I have been busy working on other things. Yes, I can fix that today. Expect another big update coming soon!

decaf-dev commented 2 months ago

Should be fixed in 1.43.1. Let me know if it still causes you issues.

Moyf commented 1 month ago

image

Updated to 1.44 and still see the broken image: image

I've tried the "Clear cache" button in the setting page.

Here is one of the URL with broken image, in case you need to test: https://cp.cc1234.cc/#stories


My settings: image

Moyf commented 1 month ago

Oh, by the way, I wanted to share a video I came across a few days ago:
https://www.youtube.com/watch?v=9mVHCnie4Lo

I'm not certain if it will be helpful, but I hope it can assist you! :)

decaf-dev commented 1 month ago

That's very odd. I do not get a broken image for that link.

decaf-dev commented 1 month ago

I do see that it doesn't have a social media image though.

image
decaf-dev commented 1 month ago

Could you set your plugin log level to Trace in the settings and then open vault explorer and give me a screenshot like the one I just sent?

Moyf commented 1 month ago

hmm, interesting, I didn't see the url: image

Oh, actually the broken image is a "app://" image

src="app://71c3320d386de07c857d37f347589d5259d6/H:/Docs/Obsinote/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/Obsidian/Plugins/Assets/comp-tool-%E7%BB%9F%E8%AE%A1%E5%B0%8F%E7%BB%84%E4%BB%B6.components?1722218406158"

The related logs: image

And the page..

WAIT A MINUTE I THINK I FOUND OUT WHY! image

It contains some specific attachment ( xx.components ) and it's not image!

And this is wrongly recognized as a "image" and the render failed!

It's not related to "Social Media Image" (Sorry I think it wront), but the ![[xxx.comopnent]] file in page.

decaf-dev commented 1 month ago

So the url: https://cp.cc1234.cc/#stories doesn't create a broken image?

Moyf commented 1 month ago

So the url: https://cp.cc1234.cc/#stories doesn't create a broken image?

image Yes, I mistakenly thought it was a problem with the Url, but it wasn't. It's actually the .component file's link in my note causing this issue.

And I guess other non-image attachment 's reference link (for example, ![[test.xlsx]] ) would also causing the same issue?

Now all Social Media Images works on my end.

decaf-dev commented 1 month ago

Gotcha. I will check this out.