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

BUG - Image Stays On Screen When Deleting Last Image In Directory #837

Closed
RainfallWithin opened this issue Aug 13, 2020 · 9 comments
Closed
Assignees
Milestone

Comments

@RainfallWithin
Copy link

RainfallWithin commented Aug 13, 2020

System information:

  • Windows OS version: Windows 10 1903
  • ImageGlass version: 7.6.4.30

To Reproduce

Steps to reproduce the behavior:

  1. Delete the last image in a directory.

Actual behavior:

ImageGlass continues to show the image that was deleted.

Expected behavior:

ImageGlass should show a blank screen with the message 'Reached the last image'.

Screenshots:

Before last image deletion:
Screenshot (688)

After last image deletion:
Screenshot (689)

Additional context:

Previous versions of ImageGlass correctly showed a blank screen after deleting the last image. ImageGlass Moon 7.6.7.12 still has the same bug.

@RainfallWithin
Copy link
Author

RainfallWithin commented Aug 13, 2020

I have installed ImageGlass 7.0.7.26 and will continue using that version for the time being because it works correctly.

Here are screenshots of the expected behaviour from ImageGlass 7.0.7.26.

Before last image deletion:
Screenshot (694)

After last image deletion:
Screenshot (695)

@d2phap
Copy link
Owner

d2phap commented Aug 14, 2020

Hi @RainfallWithin

Just asking if you checked the option: "Loop back viewer to the first image".
The "Reached the last image" message only shown if this option is unchecked.

image

@RainfallWithin
Copy link
Author

Hello d2phap,

Yes, I always have that option unchecked. I configure ImageGlass this way every time I install it. In ImageGlass 7.0.7.26 the screen becomes blank when deleting the last image, but in versions after that the deleted image stays on screen.

Here are my settings:
{76F6C4AA-ECD0-4437-BE1E-F1A3524A74E8}

{E25BB4EE-3DB7-4917-92DF-323B6182FC23}

@d2phap
Copy link
Owner

d2phap commented Aug 14, 2020

Thanks @RainfallWithin
I will investigate on it

@RainfallWithin
Copy link
Author

Thank you very much, d2phap. I will be patient. I'm happy to spend time testing anything you suggest.

@fire-eggs
Copy link
Collaborator

I took a look at this, and it seems a little difficult to fix this "cleanly". Here are my findings for Phap to make the executive decision ...

The change is to frmMain.cs\NextPic(), currently at line 626-631. The code currently reads:

            if (!Configs.IsSlideshow && !Configs.IsLoopBackViewer) {
                //Reach end of list
                if (tempIndex >= Local.ImageList.Length) {
                    ShowToastMsg(Configs.Language.Items[$"{Name}._LastItemOfList"], 1000);
                    return;
                }

So in the "normal" case, when the end of the list is reached (loop back is OFF), then the last image is still displayed and the Toast message is on top.

My change, which provides the specific behavior requested by the OP, is:

            if (!Configs.IsSlideshow && !Configs.IsLoopBackViewer) {
                //Reach end of list
                if (tempIndex >= Local.ImageList.Length) {

                    // Issue #837 : when the last image in the list has been deleted,
                    // and IsLoopBackViewer is off, do not keep showing the (now deleted) image.
                    if (Local.CurrentIndex >= Local.ImageList.Length) {
                        picMain.Image = null;
                    }

                    ShowToastMsg(Configs.Language.Items[$"{Name}._LastItemOfList"], 1000);
                    return;
                }

With this code, in the "last image deleted" case, the image is cleared and the Toast message appears. The "normal" case is unchanged.

I say this isn't "clean" because the title bar still shows the details about the now deleted image, including inaccurate file counts (nn/nn). If I throw an UpdateStatusBar() call in there, then the title bar is blanked except for even worse file counts (e.g. image 13/12).

I think the "clean" solution may be to call NextPic(-1) instead of picMain.Image = null. Now the "normal" case is still unchanged; for the "last image deleted" case, the display switches to the new "last" image, with the Toast message on top, and the title bar showing valid info. But doing so does not provided the solution as requested by the OP.

@RainfallWithin
Copy link
Author

RainfallWithin commented Sep 5, 2020

@fire-eggs, I really appreciate the time you have spent on this.

The change of code you have suggested is exactly what I was hoping for, and your worry about the title bar still showing the details of the now deleted last image is not a problem to me, and in fact might be useful in some circumstances.

I often sort and delete hundreds of images that are very similar in appearance. A blank screen when deleting the last image is very helpful. If the screen isn't blank after I've deleted the last image, I don't notice that I've reached the end and try to continue the sorting, with the belief that the image on the screen is a new image I've not yet reviewed.

I say this isn't "clean" because the title bar still shows the details about the now deleted image

I tested ImageGlass 7.0.7.26 which had the preferred behaviour (showing a blank screen after deleting the last image), and its behaviour matches what you described.

{86127EB9-5AD2-4172-8CF2-22CE5E69A314}

Screenshot (853)

Screenshot (855)

As you can see, the last image's name, 'Screenshot 620.png', still shows in the title bar after deletion.

This is something I never noticed until you pointed it out, and in my opinion is not an issue, and may in fact be helpful if I want to quickly check the name of the last image I deleted.

..., including inaccurate file counts (nn/nn). If I throw an UpdateStatusBar() call in there, then the title bar is blanked except for even worse file counts (e.g. image 13/12).

In ImageGlass 7.0.7.26, you can see from my screenshots that the file count stays at 2/2 when deleting the last image, even though there is 1 image left in the directory. I think it is completely OK to leave it this way. Technically I'm still on the last image when the screen has become blank, and the first thing myself and other users will do after reaching the end is to close ImageGlass, or select another image which will update the file count.

@fire-eggs
Copy link
Collaborator

Thanks for the feedback! I should have confirmed the behavior of an older version.

@d2phap d2phap added this to the v9.0.9 milestone Dec 14, 2023
@d2phap
Copy link
Owner

d2phap commented Dec 28, 2023

Should be fixed in ImageGlass 9.0.9.1230

@d2phap d2phap closed this as completed Dec 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants