tophf / mpiv

A fully reworked fork of Mouseover Popup Image Viewer
MIT License
167 stars 21 forks source link

[Galleries] `index` is not taken into account, and sometimes as you switch images, the current one is stretched/shrinked horizontally to the width of the next one #122

Closed darkred closed 1 month ago

darkred commented 2 months ago

Summary:

I have noticed two issues with galleries:

Steps to reproduce the bug

Screen capture: ![](https://github.com/user-attachments/assets/5b45aa80-500c-4000-a90c-279f7dc604c0)

Environment

tophf commented 2 months ago

Should be fixed now.

darkred commented 2 months ago

Yes, it's fixed. Thanks a lot for your quick response!

darkred commented 1 month ago

Hi @tophf . Unfortunately I recently see that it still occurs. If you reproduce the STR from OP, disable cache in Network devtools, mouseover 4nd thumb (wait for full image popup to complete) and scroll to 5th image, the issue occurs consistently. Tested with latest TM beta 5.3.6211 and VM beta 2.20.5 (Chrome 129/Firefox 130).

Screen capture: ![](https://github.com/user-attachments/assets/a9db9adb-48f4-458a-b944-5c04d6bad637)
darkred commented 1 month ago

Thanks a lot once again! I just noticed one thing: with the latest changes, now on mouseover there's a white placeholder initially, and then the image is gradually loaded. Is this necessary as part of the fix, or could it be avoided? (earlier the background was transparent)

Screen capture: ![](https://github.com/user-attachments/assets/1182df95-f170-4b11-8b24-1bdd262bda13)
tophf commented 1 month ago

Is it Firefox? Looks like that ancient bug with images that always existed. I tried circumventing it by reusing the image, but it caused the problems with proportions.

tophf commented 1 month ago

You can enable Wait for complete image in MPIV options.

darkred commented 1 month ago

It occurs in both Chrome and Firefox, stable and even in nightly/canary. Ok, I see. Thanks for the tip, and again for the help!

tophf commented 1 month ago

It doesn't occur for me in Chrome.

tophf commented 1 month ago

I guess it's a bug in your GPU driver. Try installing a newer or a much older version.

darkred commented 1 month ago

My GPU is an NVidia GTX 1660Ti. The latest drivers 561.09 are very recent, released just two weeks ago. I'd prefer not to install an older driver because the current one supports a game I'm currently playing and another I'm interested in.

darkred commented 1 month ago

I just found that the issue with the white placeholder is essentially the same as #75 of four years ago (also reported by me four years ago, I had totally forgotten about it, sorry).

Anyway, regarding Firefox, there's this old and and unfortunately still open bugzilla bug 1556156 White background during image loading which I had mentioned in here https://github.com/tophf/mpiv/issues/75#issuecomment-942297323 . In other words, in Firefox the "white placeholder" issue always occurs, regardless of your latest commit. Sorry I got confused.

But, regarding Chrome, the "white placeholder" issue doesn't seem to be a browser bug: it started occurring with your https://github.com/tophf/mpiv/commit/e0b10f7d447ad3b7a17f653c237cfd9065be90fb commit. It didn't occur with previous commit https://github.com/tophf/mpiv/commit/64c59c43d4652604b88f7ad63df06020f1719d0c

Having in devtools 'Network':

the white placeholder issue when mouseover 4th thumb occurs for me consistently with Chrome.

  I understand that this "white placeholder" issue must be a necessity in order not to have the problem with proportions, as you said, so I'd consider it something unavoidable.

tophf commented 1 month ago

it started occurring with your e0b10f7d447ad3b7a17f653c237cfd9065be90fb commit

This commit restored the ancient behavior, i.e. a new image is created when advancing in a gallery, so it is a bug in the browser that you reported in #75 and I still can't reproduce it. I'll try to understand the difference between the code back then, which fixed it for you, and now...

the white placeholder issue when mouseover 4th thumb occurs for me consistently with Chrome

Definitely a bug in Chrome or in GPU driver. Doesn't occur for me.

tophf commented 1 month ago

Regarding my "I'll try to understand the difference between the code back then, which fixed it for you, and now...", I've looked at the code and if I restore that, there'll be a bug in proportions.

tophf commented 1 month ago

BTW I've never seen it (the white background) in Chrome, and I can't even find any mentions of such a bug in Chrome in the internet...

tophf commented 1 month ago

Try adding #mpiv-popup.mpiv-show { background:none!important } to Custom CSS in options. And maybe #mpiv-popup.mpiv-show { box-shadow: none !important }

darkred commented 1 month ago

The combination of these two rules completely solved the issue in Chrome! Thank you so much!

Screen capture: ![Animation99~~~4](https://github.com/user-attachments/assets/a7154ebb-b181-4bf9-b872-6b678a7bd00a)