.setImage will not re-load images if file name doesn't change #87

Closed
aricooperdavis opened this Issue Jan 19, 2017 · 5 comments

Comments

Projects
None yet
2 participants
@aricooperdavis

aricooperdavis commented Jan 19, 2017

As title, the .setImage function will not update what is displayed by an Image widget if the image's filename/path does not change, even if the image itself does change.

This means that if another program updates the image then this change won't be reflected by the appJar app.

This is an issue with python applications that may use something like PIL to update images as they're in use by the appJar app.

Minimum working example attached.
Image_Issue.zip

@aricooperdavis aricooperdavis changed the title from .setImage will not re-load images if file name is the same to .setImage will not re-load images if file name doesn't change Jan 19, 2017

@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Jan 19, 2017

Owner

appJar caches images, based on filename.

There are therefore a couple of things that can be done here.

  1. Add a function to force an image reload: .reloadImage() This would be a trivial change, and would update the cache with the new image (even if it's the same).
  2. Change image caching, so that instead of just image name, it also checks something else - a checksum hashlib.md5() or last modification date os.path.getmtime(path)

I'll look into getting (1) added for the next patch release (due this weekend), and will add (2) to the backlog ...

Owner

jarvisteach commented Jan 19, 2017

appJar caches images, based on filename.

There are therefore a couple of things that can be done here.

  1. Add a function to force an image reload: .reloadImage() This would be a trivial change, and would update the cache with the new image (even if it's the same).
  2. Change image caching, so that instead of just image name, it also checks something else - a checksum hashlib.md5() or last modification date os.path.getmtime(path)

I'll look into getting (1) added for the next patch release (due this weekend), and will add (2) to the backlog ...

@jarvisteach jarvisteach self-assigned this Jan 19, 2017

@aricooperdavis

This comment has been minimized.

Show comment
Hide comment
@aricooperdavis

aricooperdavis Jan 20, 2017

Fantastic, (1) sounds absolutely perfect to me, thanks for your quick and efficient response!

Fantastic, (1) sounds absolutely perfect to me, thanks for your quick and efficient response!

jarvisteach added a commit that referenced this issue Jan 21, 2017

jarvisteach added a commit that referenced this issue Jan 21, 2017

@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Jan 21, 2017

Owner

New version has been released (0.041) with reloadImage() function

Owner

jarvisteach commented Jan 21, 2017

New version has been released (0.041) with reloadImage() function

@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Jan 21, 2017

Owner

Hey @aricooperdavis , hope you don't mind, but I used your balloon image in a sample on the images page

Owner

jarvisteach commented Jan 21, 2017

Hey @aricooperdavis , hope you don't mind, but I used your balloon image in a sample on the images page

jarvisteach added a commit that referenced this issue Jan 21, 2017

Image streamlining - new functions to getFullPath, and check if image…
… has changed, based off modtime, as well as tweak to cache checking (#87)
@aricooperdavis

This comment has been minimized.

Show comment
Hide comment
@aricooperdavis

aricooperdavis Jan 21, 2017

@jarvisteach I confess that I didn't create that image, I found it here.

@jarvisteach I confess that I didn't create that image, I found it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment