immich-app / immich

High performance self-hosted photo and video management solution.
https://immich.app
GNU Affero General Public License v3.0
44.59k stars 2.17k forks source link

privacy.resistFingerprinting=true degrades photo sphere viewer #8569

Open hrdl-github opened 5 months ago

hrdl-github commented 5 months ago

The bug

Running librewolf or firefox with privacy.resistFingerprinting=1 set via about:config or about:preferences reduces the screen resolution used by the photo sphere viewer, secerely impacting image quality.

The OS that Immich Server is running on

Arch Linux

Version of Immich Server

v1.101.0

Version of Immich Mobile App

n/a

Platform with the issue

Your docker-compose.yml content

n/a

Your .env content

n/a

Reproduction steps

1. Configure librewolf or firefox to enable `privacy.resistFingerprinting`
2. View any photo sphere

Additional information

No response

mertalev commented 5 months ago

Have you tested with this setting on and off?

hrdl-github commented 5 months ago

I have. Disabling the setting in librewolf (which enables it by default) restores the image quality while enabling the setting in firefox degrades the quality. I tested this using firefox and librewolf 124 on GNU/Linux.

mertalev commented 5 months ago

Fingerprinting includes things like GPU model, right? Just a guess, but sending fake data for that might be messing with the WebGL library used in photo-sphere-viewer.

hrdl-github commented 5 months ago

In this case it's the texture and render buffer sizes that are being limited: https://github.com/mistic100/Photo-Sphere-Viewer/issues/1281#issuecomment-2041942770 and https://github.com/mistic100/Photo-Sphere-Viewer/issues/1281#issuecomment-2042047994 . The first comment also suggests a viable workaround, which requires an official plugin as well as splitting the original file: https://photo-sphere-viewer.js.org/guide/adapters/equirectangular-tiles.html#preparing-the-panorama

mertalev commented 5 months ago

Hmm, splitting images into tiles is a bit of a pain. We'd need to make a new table to store the paths to these tiles. But it sounds like it'd be a good change in general so it might be worth it.

hrdl-github commented 5 months ago

At least initial loading is much faster, which is a nice side effect. A downside is that the textures are not preloaded, causing the upscaled base image (e.g. 2048x1024) to be visible for a very brief time the first time a texture is loaded.