fabiocolacio / Marker

🖊 A gtk3 markdown editor
GNU General Public License v3.0
832 stars 75 forks source link

Image changes don't update in Marker #369

Open kq1231 opened 2 years ago

kq1231 commented 2 years ago

I use Marker to make notes for math. For making diagrams and plots, I prefer using matplotlib as it's extremely amazing and packed with too many features. In Marker, I am able to import and view an image. However, when I update the image by modifying my plot, I can see the image getting updated:

  1. When I'm viewing my markdown file in chrome (using the extension: markdown preview plus).
  2. In my OS file manager.

However, Marker is not able to update the image. What's even funnier is that even if I delete the image from my system, it still shows the same image! Thank you!

kq1231 commented 2 years ago

Is that because I'm importing the image using HTML?

violetmage commented 2 years ago

greetings

thank you for your well written issue report

are you using the flatpak?

this behavior sounds like something ostree might do

kq1231 commented 2 years ago

Hello! Yes, I'm using flatpak.

violetmage commented 2 years ago

sorry for the delayed response, though i suppose there is no excuse for laziness...

anyway, i was able to reproduce your issue after i figured out how pictures work in markdown, and it appears my hunch is correct, that when "importing" something to marker, ostree makes it's usual sandboxed copy, and so the file must be "reimported" to see changes to the original copy

as you can probably tell, i mostly use marker for simple edits, and not all that often.

how exactly are you "importing" your pictures in marker?

kq1231 commented 2 years ago

i usually import using the html tag

On Sun, 24 Apr 2022, 3:53 am violetmage, @.***> wrote:

sorry for the delayed response, though i suppose there is no excuse for laziness...

anyway, i was able to reproduce your issue after i figured out how pictures work in markdown, and it appears my hunch is correct, that when "importing" something to marker, ostree makes it's usual sandboxed copy, and so the file must be "reimported" to see changes to the original copy

as you can probably tell, i mostly use marker for simple edits, and not all that often.

how exactly are you "importing" your pictures in marker?

— Reply to this email directly, view it on GitHub https://github.com/fabiocolacio/Marker/issues/369#issuecomment-1107661498, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVER2N2L33KFFHEIPPGUWTLVGR5MVANCNFSM5LCRDNUQ . You are receiving this because you authored the thread.Message ID: @.***>

violetmage commented 2 years ago

again, sorry for my lack of attentiveness

yes, have experimented some more, it seems it doesn't matter how marker reads the image file, there is a cache somewhere that holds the contents of files referenced from documents in marker, once marker reads them once, they are never reread / reloaded until the cache is cleared (?), the marker document is reopened, or marker is reopened.

furthermore, my original guess seems wrong, as the behavior is identical with files that i have given my marker flatpak unsandboxed access to.

this is probably an unintended side effect of reducing complexity by reading each file once, and keeping them in memory until the document is closed

my intuition leads me to believe, in that case, that this has become a feature request for "reload document"

@fabiocolacio thoughts?