d2phap / ImageGlass

🏞 A lightweight, versatile image viewer
https://imageglass.org
Other
7.68k stars 499 forks source link

Zooming using the mouse wheel on a SVG file with Webview2 doesn't work #1766

Closed Tomoko1 closed 2 months ago

Tomoko1 commented 10 months ago

System information:

To Reproduce

Steps to reproduce the behavior:

  1. Open a SVG file with the setting "Use Webview2 for viewing SVG format" enabled
  2. Attempt to zoom in and out with the mouse wheel

Actual behavior:

I can zoom in or out once on an image but trying to zoom in or out more than that makes the image disappear. Afterwards, making the image reappear is impossible. When zooming in and out, the title bar also shows weird zoom values. Zooming in or out by clicking on the buttons in the toolbar works as expected, but the title bar also shows weird zoom values. (e.g. after zooming out on an image, the title bar shows a zoom value of "731.139.086.026.276.864%")

Expected behavior:

Zooming in and out should work as expected.

Screenshots:

After zooming in with the mouse wheel once zoomin After zooming in with the mouse wheel twice zoomin2

Additional context:

I have "Use smooth zooming" enabled, but a similar bug happens with this setting disabled too.

d2phap commented 10 months ago

Hi @Tomoko1 Can you help me check if there are any error in WebView2. You can follow these steps:

image

Tomoko1 commented 10 months ago

Hello. Here's a screen of the console (I zoomed in twice with the mouse wheel and then tried to zoom out once) zoom1 Here's also a screen of the console when I zoom out with the buttons in the toolbar. zoom2

VOOM108 commented 9 months ago

I have the exact same issue. IG 9.0.9.1230 on Win 11. Checking to use Webview2 or not does not make a difference.

DanRotaru commented 9 months ago

Same issue for long timeπŸ«₯

Koushakur commented 8 months ago

Still an issue in 9.0.10.201 (64-bit). "Actual size" and "Scale to fit" work, but any manual zoom-in instantly sets it to 10000% zoom. Then, depending on if 'smooth zoom' is on or not, it either only goes between 10000% and 0% (according to the titlebar, actual zoom is closer to 8k?, most definetly not 0%), or with smooth zoom off it goes 10000% -> 8000% -> 6000% -> 4500% -> 0%.

Turning off webview2 and restarting imageglass makes svgs function as a normal rasterized image

image Top to bottom it's setting mode to actual size, setting mode to scale to fit, zoom in, then zoom out four times, after which no more zoom out is processed

triget commented 4 months ago

I conducted a small investigation. When I export a file with the 'Set Viewbox' option from Affinity Designer, I can't zoom in using ImageGlass, but the size always remains at 100%.

When I export the file without this option, the zoom increases to 10000%. I also checked on two other computers where I have ImageGlass, and the effect is the same.

image

triget commented 3 months ago

I believe this issue should be treated as a priority because the inability to zoom SVGs eliminates the possibility of using ImageGlass in daily work. In the old version (version 8), there were no such problems. I'm surprised that nothing has been done about this since December 2023.

d2phap commented 3 months ago

@triget Can you send your sample SVG file?

You can uncheck this setting to switch to the native SVG renderer (same as v8). This is still on my priority list, but also depends on whether I can reproduce the issue, the difficulty, and my time.

image

triget commented 3 months ago

@d2phap I packed the SVG into a .zip file to make it easier to download from GitHub.

Btw. Thank you for the suggestion to switch to native SVG viewing. Now the zoom works.

test.zip

Unfortunately, there are now issues with some elements. Look at how the letter S appears compared to the T next to it.

problem

d2phap commented 3 months ago

Unfortunately, there are now issues with some elements. Look at how the letter S appears compared to the T next to it.

The native renderer is same as v8, it does not support scaling.

I tried opening your SVG file with v9.1.7.627, it works fine:

https://github.com/d2phap/ImageGlass/assets/3154213/f7260038-cacf-486a-a14c-80d9b1c01a1c

d2phap commented 3 months ago

@triget Can you help me download & test this build?

It contains logging function to create a log file __ig_web2_log.log when the app closed. Please follow these scenarios:

Scenario 1: Mouse Scroll Down (Slow)

  1. Open your SVG file with ImageGlass
  2. Scroll down your mouse 3 times (or 3 scrolls)
  3. Close the app, go to IG_SVG_Debug and copy the log file, attach here

Scenario 2: Mouse Scroll Up (Slow)

  1. Open your SVG file with ImageGlass
  2. Scroll up your mouse 3 times (or 3 scrolls)
  3. Close the app, go to IG_SVG_Debug and copy the log file, attach here

Scenario 3: Mouse Scroll Down (Fast)

  1. Open your SVG file with ImageGlass
  2. Make long Scroll down your mouse multiple times
  3. Close the app, go to IG_SVG_Debug and copy the log file, attach here

Scenario 4: Mouse Scroll Up (Fast)

  1. Open your SVG file with ImageGlass
  2. Make long Scroll up your mouse multiple times
  3. Close the app, go to IG_SVG_Debug and copy the log file, attach here

Scenario 5: Mouse Scroll Down + Up

  1. Open your SVG file with ImageGlass
  2. Scroll your mouse in any direction multiple times
  3. Close the app, go to IG_SVG_Debug and copy the log file, attach here

Scenario 6: Use Trackpad

  1. Open your SVG file with ImageGlass
  2. Slowly move 2 fingers down on the trackpad
  3. Slowly move 2 fingers up on the trackpad
  4. Close the app, go to IG_SVG_Debug and copy the log file, attach here

After finishing all the scenarios, you should attach here 6 log files. Thank you!

triget commented 3 months ago

@d2phap

I have executed scenarios 1-5. I do not have a trackpad (I think this is not a problem). In the scenario where I have to zoom the file, I can only do it once. After zooming in on the file, it immediately reaches 10000% magnification and nothing else can be done. I am attaching a .zip file with logs. If you need anything else, just let me know. I am happy to test/help.

scenario.zip

I have attached a video recorded on your test build @d2phap

https://github.com/d2phap/ImageGlass/assets/9076850/2759e745-599c-4185-869b-547b12cf0b0e

If it helps, I am open to scheduling a session on TeamViewer or a similar tool, and you can test things out yourself to see how everything works :)

d2phap commented 3 months ago

@triget Thanks a lot! I have been on a trip so I will try to check & get back to you when I have time.

d2phap commented 3 months ago

OK, I managed to reproduce it. This issue happens when your Decimal symbol is not .

image

triget commented 3 months ago

@d2phap Can you manage to fix this? Not everywhere can the decimal symbol be used as a dot.

d2phap commented 3 months ago

@triget It should be fixed in this build: https://drive.google.com/file/d/1e5y97jKVM7QWR2q5Py1-WsgOEzE93T18/view?usp=sharing

Tomoko1 commented 3 months ago

I can confirm that the issue has been fixed for me in that build πŸ˜‡πŸ’–

d2phap commented 2 months ago

Fixed in ImageGlass 9.1.8.723