Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Images still stays in images folder after been removed from boostnote #740

Closed
Alaev opened this issue Jul 30, 2017 · 15 comments
Closed

Images still stays in images folder after been removed from boostnote #740

Alaev opened this issue Jul 30, 2017 · 15 comments
Labels
feature request 🌟 Issue is a new feature request.

Comments

@Alaev
Copy link
Contributor

Alaev commented Jul 30, 2017

Please paste some screenshots with opening the developer tool if you report a bug.

Dropping image into boostnote will add it to images folder with a random name up to here all works great.

  • Removing the image for boostnote aka deleting the line of the image from the markdown file boostnote will not remove the image from the folder.
  • Adding the same image boostnote will create a new file for that exact image even if it existed in the markdown file.

I think with this kind of behavior the images folder will be getting big very fast with some duplicated images all over it.

would love to hear your thoughts on it.

boostnote

boostnote

boostnote markdown

boostnote markdown

images folder

images folder

@asmsuechan
Copy link
Contributor

Removing the image for boostnote aka deleting the line of the image from the markdown file boostnote will not remove the image from the folder.

It's not unnatural because there's no relation between the note itself and the image. Take GitHub for example, you can upload an image on an issue comment and it won't delete even though you delete the line of an image in the comment.

Adding the same image boostnote will create a new file for that exact image even if it existed in the markdown file.

As same as the above, take GitHub for example. You can upload the same image in 1 comment with no warning.

I think with this kind of behavior the images folder will be getting big very fast with some duplicated images all over it.

That's true. But what's the matter? That does not matter of the speed of loading notes.

@Alaev
Copy link
Contributor Author

Alaev commented Jul 30, 2017

No speed loading is great. The app works awesome. just thinking about the image folder that can grow very fast into a big mess that will be hard to know what images you are using and what are safe to remove.

@asmsuechan
Copy link
Contributor

I didn't notice the necessity of image deletion. I'll consider it.

@asmsuechan asmsuechan added the feature request 🌟 Issue is a new feature request. label Jul 30, 2017
@yashha
Copy link

yashha commented Aug 1, 2017

Especially with the history function it will be buggy when going back, saving, and going forward.
Maybe we add an clean button in the info modal?

@asmsuechan
Copy link
Contributor

an clean button

Good idea

@yashha
Copy link

yashha commented Aug 1, 2017

It don't have to be in the info modal
It could be in the preferences.

@teatwig
Copy link

teatwig commented Aug 18, 2017

It would be nice if we could easily search for images not used in any notes and delete them manually/automatically.

@asmsuechan
Copy link
Contributor

asmsuechan commented Aug 22, 2017

I use a one-liner to remove files no longer used.

If you want to use it, run it in your storage. (Please don't forget backup just in case)

find . -type f -name "*.cson" | xargs grep -E ':storage(.+?).png|Boostnote/images/(.+?).png' -n | sed -e 's/^.*\///g' | sed -e 's/).*//g' > images.txt && ls images | while read line ; do if [ ! $(cat images.txt | grep $line) ]; then  rm images/$line ;fi ; done && rm images.txt

@ppdg123
Copy link

ppdg123 commented Dec 28, 2017

yes, it's a good feature!

@tatoosh
Copy link

tatoosh commented Dec 28, 2017

@asmsuechan thx for the code.
Do you also have a windows snippet?

@tatoosh
Copy link

tatoosh commented Jan 17, 2018

Any changes so far for the native app without script?

@CraigDamlo
Copy link

This is a good idea, I had an issue today where I was trying to drop in an image and placed it in the wrong spot so I deleted the image and dropped it in a different (correct) spot. Later I noticed that the image was in my image folder twice because of this method of moving it.

@IssueHuntBot
Copy link

@ehhc has started working. Visit this issue on Issuehunt

@IssueHuntBot
Copy link

@ehhc has submitted output. Visit this issue on Issuehunt

@IssueHuntBot
Copy link

@kazup01 has rewarded. Visit this issue on Issuehunt

Rokt33r added a commit that referenced this issue May 15, 2018
Deleting of attachments -> fixes #1828 and fixes #740
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request 🌟 Issue is a new feature request.
Projects
None yet
Development

No branches or pull requests

8 participants