Clean Un-used Image of Markdown File

The embedded WYSIWYG markdown editor is the most convenient way to create, edit, and publish md files.

When I paste an image into the md editor, it will automatically create a folder named “images” and make a new image file in that folder to store the image. This image is then inserted into the md editor, which is very cool.

The problems is, when I delete the image in md file, the image file in the “images” folder will not be deleted. That means if I heavily editing a md file with many pictures, the unused image might soon overwhelm the “images” folder and waste a lot of space.

So is there any way to clean the un-used images created by the md editor?

P.S. If “clean” un-used image can be done, then it may require a database to store whether an image is used or not, which is for sure out of the ability of SeaFile. So I think what SeaFile can do might be deleting the image file when the image link is deleted in the md file.

I am not sure whether Seafile have some mechanism to handle this? Any one has a clue?

Hello again,

pictures inserted in MD files have to be saved somewhere within Seafile. Seafile’s approach of saving pasted pictures in an “images” subfolder makes working with MD files swift and uninterrupted.

Unfortunately, there is no way of deleting unused pictures from the images folder. The proposed ‘delete-file-in-images-folder-when-picture-in-MD-file-gets-deleted’ is not supported either. (I would also vote against it. Image storage and image usage are two separate things.)

Instead of inserting local pictures - by dragging and dropping or using the menu item ‘upload local image’ (see screenshot) - you can insert images already saved in one of your own or a shared library. They are linked at source and not cached in said images folder. For most use cases, I would prefer library images to uploaded local images.

Besides, when using images in a web format (72dpi, reasonable dimensions), it takes tons of pictures in the images folder to consume space to speak of. By the way, using these formats is in your own interest because MD files load faster.

Thanks again.

Sure, upload images with clear file name and inserted into md later is a good behavior. And, the purpose of markdown is not for a file heavily loaded with images need editing.