ozntel / oz-image-in-editor-obsidian

This Obsidian plugin to view Images, Transclusions, iFrames and PDF Files within the Editor without a necessity to switch to Preview.
339 stars 13 forks source link

Good Feature: Add % to resize and render image #110

Closed fengyuan213 closed 1 year ago

fengyuan213 commented 2 years ago

For example, I have a filename of screenshot of my desktop, it's name is pic1.jpg It has size of 300x300 px and I want it to be 150x150 pixels. To achieve that, I need to use tag: ![[pic1.jpg|150x150]]. It is complicated and I need to know the image size for every specific image. Is it possible to add a small feature to just use something like: ![[pic1.jpg|50%]] to achieve the same effect or something similar?

ozntel commented 1 year ago

You can use #small (%75), #x-small (%50) or #xx-small (%25) as an alt text to resize your images with percentages. If you install additionally Style Settings Plugin, you can also customize these percentages for each alt text separately:

image