d2phap / d2phap/ImageGlass

Image doesn't reload when all files are deleted and then replaced

Open
#470 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

🐞 bug
Dominant language
C#
Stars
14.4k
Forks
752
Avg merge
10d 14h
Merged PRs (30d)
1

Description

System information:
  • Windows OS version: Windows 10
  • ImageGlass version: 5.5.7.26
To Reproduce

Steps to reproduce the behavior:

  1. Open a PNG file with ImageGlass.
  2. Rewrite the image with an external tool. In my case, I am using Spine to pack a texture atlas. Spine deletes the image file, performs texture packing (which can take between milliseconds to a couple seconds), then a new image is written.
Actual behavior:

ImageGlass goes blank, then either reloads the file and shows the new content (as desired), or does nothing and stays blank (not desired). It stays blank about 33% of the time. This is very frustrating, as I have to go to the file on disk and open it again.

Expected behavior:

I expect ImageGlass to always reload the file and show the new content, never to stay blank.

Additional context:

My guess is that ImageGlass sees the image has been deleted, then gives up too quickly. When the new image file is created with the same name, ImageGlass has already given up and doesn't load it. It would be great if, when ImageGlass sees the file it has loaded has been deleted, that ImageGlass would continue looking for that file in case it comes back.

If there must be a timeout, it could be quite long (maybe 5-10 seconds), but I don't think it ever needs to timeout. If the file ever comes back, it should be reloaded.

BTW, thank you again for all the effort you put into ImageGlass!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Start by reproducing the delete-and-replace sequence on Windows 10 and trace ImageGlass's file-change handling when the currently viewed image disappears. Done means the replacement image is reliably reloaded instead of leaving the viewer blank.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.