zhouhua / obsidian-export-image

Easily convert your article to image.
MIT License
104 stars 4 forks source link

Some suggestions for improvement #23

Closed merlinuwe closed 8 months ago

merlinuwe commented 8 months ago

I'm so happy that your plugin finally runs again.

Here are some suggestions for improvements:

I saw, that with an image width of 640 px (default) I get an 1244 px width image.

image

Thanks again for your great plugin.

zhouhua commented 8 months ago

In fact, you can enter a large width value in this input.

image

In order to make the image clearer, the exported image of this plugin is actually twice the resolution, which can make the exported image sharper on high PPI screens (such as mobile phones). You mentioned setting the width to 640, but exported the width to 1244 instead of 1280, which may be a potential bug. I will confirm it later.

As for whether to increase the width of the dialog box, my idea may be different. Simply adjusting the size of the dialog box cannot meet all scenarios. I think a more reasonable way is similar to image preview, which can be directly dragged with the mouse and easily zoomed in and out. Currently, the preview area in the dialog box is not an image. In order to have better responsiveness when adjusting the width, I did not generate an image immediately when adjusting the width, but clicked the button below to generate the image. I think maybe I can try to present the final image directly during the preview.

The last suggestion is great, I will try to add this feature.

merlinuwe commented 8 months ago

Your idea is better than mine. ;-)

zhouhua commented 8 months ago

Today I developed the features of your proposal. You can try the 2.1.0 version. In the preview interface, you can move and zoom the image (no scroll bars). I also added a function entry in the editor menu:

image

merlinuwe commented 8 months ago

Well made, thank you very much.

During testing, I found that unchecking the "Including file name as title" checkbox has no effect. The title is always at the top of the output.

image

Are you still thinking about the scaling of the pixels? I set "Image width" to 1000 but I get 1964. When set to 2000 I get 3964. With the default of 640 I get 1244.

Cosmetics: I cannot completely delete the number with the backspace key. A zero (0) remains.

image

zhouhua commented 8 months ago

During testing, I found that unchecking the "Including file name as title" checkbox has no effect. The title is always at the top of the output.

It works fine on my computer:

image

Can you help me take a screenshot to see what the editor view looks like?

Are you still thinking about the scaling of the pixels? I set "Image width" to 1000 but I get 1964. When set to 2000 I get 3964. With the default of 640 I get 1244.

I guess the scroll bar on the right side is interfering with the calculation. I tested it on a mac, and the scroll bar on the mac is floating above the element, so it does not affect the width calculation. I will do some compatibility later for this situation.

Cosmetics: I cannot completely delete the number with the backspace key. A zero (0) remains.

My initial idea may have been a bit over-designed, but I think I can let go of the limitations of Input.

zhouhua commented 8 months ago

I just released a new version that solves the problem of width input and also tries to fix the scroll bar problem on Windows, but I am not sure if it works because I don't have a Windows computer at the moment.

merlinuwe commented 8 months ago

Looks far better, now (Windows 11).

If I give 5000 px I get 9966 px. It I give 10000 px I get 19966 px.

The issue with the not deletable 0 is solved.