0

I am trying to visualize some data, and my program outputs a png file. Each time when I modify my program, the output png file changes. So I hope to have an image viewer that can automatically reload the png file once it detects that the png file has changed on disk.

I have tried eog and viewnior, but none of them supports auto reload/refresh the image file. Can you suggest a better image viewer?

I think inotify is a good tool that should be able to do this, but I am not sure how to use it.

3
  • I think we are missing a bit of context? What icon? May 15, 2016 at 5:22
  • @JacobVlijm I have provided more details about my problem.
    – LaoMao
    May 15, 2016 at 5:43
  • Inotify could very well be used in a script to automatically reopen the file on changes, but reload in the currrent instance is impossible imo. May 15, 2016 at 6:17

2 Answers 2

1

I have the same problem while experimenting with imagemagick. So I have written a simple image viewer which updates itself (using inotify): https://gitlab.com/dknof/siv For compiling you need the gtkmm dev libraries, version 3. Just call siv with the image(s). You can scale them with the keys 1 - 0 and the mouse wheel.

2
  • Great job, dknof! Your siv tool does exactly what I needed. I had to install all of these: clang libgtkmm-3.0-dev ccache to get it to build.
    – daveloyall
    Apr 10, 2017 at 22:03
  • Since this website is in English, you may want to mention that the description, documentation, and even source code comments are all in German, and will not be comprehensible to most of this website's visitors. Dec 17, 2019 at 1:03
1

I have tried eog

Current versions of eog do reload the image automatically. There is also a plugin which adds an explicit reload option, if you're using filesystems such as FUSE which do not support inotify.

feh now also has an --auto-reload switch which uses inotify, along with --reload which uses a simple timer.

Many more recommendations with this feature here:

https://unix.stackexchange.com/questions/167808/image-viewer-with-auto-reload-on-file-change

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .