setImageSmoothingEnabled ignored when useSketch is true
See original GitHub issueI found some situations where image smoothing was being applied at high zoom when viewing multiple images, even though I have set the following optons when initialising the OSD Viewer:
imageSmoothingEnabled: false,
smoothTileEdgesMinZoom: Infinity,
I am using opacity to switch rapidly between multiple tileSources, by adapting a Codepen recipe on image fading by @iangilman.
The fault is intermittent, and occurs around 20x - 40x zoom on images around 3000x2000 pixels in size. The first image always has nearest-neighbour (NN) interpolation (image smoothing off), as intended. But sometimes the second image has bi-linear (BL) interpolation (image smoothing on). Occasionally, zooming or panning the second image was causing the interpolation to switch between NN and BL.
I think my use of multiple images and opacity together with certain zoom or pan conditions is triggering the useSketch flag inside drawer.js, which then creates a new context. The new context is missing the image smoothing settings.
I am about to submit a pull request which fixes this issue in my testing.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top GitHub Comments
Thank you for tracking this down! I’ve merged #1647, but let me know if you figure out what’s causing the remaining issue.
I’ve confirmed using the code before #1647 was applied that the bug described at the top of this issue still occurs when viaWebGL is disabled.
I’ve also found a new reproducible bug, using OSD with #1647 applied and viaWebGL disabled:
After resizing the browser window, the second image has image smoothing applied.