Sublime Forum

How can I preview images inside code editor?

#1

I am using Sublime Text 4
I have tried multiple plugins, but none worked for me!

I am looking for anything which allows me to preview the image inside the code editor.

1 Like

#2

What kind of “preview images” you mean? Would be better with a screenshot.

0 Likes

#3

Anything which allows me to preview the used image inside the code editor?
Example:

0 Likes

#4

Uh, isn’t that Sublime Text already?

0 Likes

#5

https://packagecontrol.io/packages/ImagePreview
the above plugin shows image previews when you hover over the url. If it doesn’t work for you, it may make sense to log an issue with a minimal reproducible example

0 Likes

#6
<html>
<body>
    <img src="https://dummyimage.com/300x200/3FB58B/000.jpg" alt="Image">
</body>
This code did not work for me. I am not getting any preview; neither in ST4 or ST3. PS: I am using windows 11. I have installed " ImageMagick" too.
0 Likes

#7

You can see that this image is actually a WebP image which hides under the .jpg extension. I don’t know why some websites do this stuff.

If you use my package, the file extension takes precedence when it decides how to render/decode the image format. I can try to change this procedure, or add a fallback for such cases, but I can’t give the guarantee that it will work and I will probably not get to that before the next weekend. Why didn’t you create an issue on the GitHub repo?

2 Likes

#8

Ah, I see.
I think webp format is used for less weight.
Anyway I can see .webp images?

PS: I am not used to using Github, sorry for that!

0 Likes

#9

WebP Image support was added in build 4149.

0 Likes