Skip to content

libvncclient: avoid Tight JPEG for deep pixel formats#707

Open
marcofortina wants to merge 1 commit into
LibVNC:masterfrom
marcofortina:fix/tight-jpeg-deep-pixel-formats
Open

libvncclient: avoid Tight JPEG for deep pixel formats#707
marcofortina wants to merge 1 commit into
LibVNC:masterfrom
marcofortina:fix/tight-jpeg-deep-pixel-formats

Conversation

@marcofortina
Copy link
Copy Markdown
Contributor

@marcofortina marcofortina commented May 16, 2026

Summary

Avoid requesting Tight JPEG when the client pixel format cannot safely consume 8-bit-per-channel JPEG samples.

Tight JPEG is an 8-bit RGB path. When the client format has more than 8 bits per RGB component, for example a 30-bit/10-bit-per-channel HDR format, requesting the Tight quality pseudo-encoding can make servers choose JPEG subencoding even though the negotiated client format cannot represent it losslessly and some servers cannot encode that source format as JPEG correctly.

Changes

  • Add a small helper that decides whether Tight JPEG should be requested for the current client pixel format.
  • Keep requesting Tight JPEG for true-colour formats with more than 8 bpp and RGB component maxima up to 8 bits.
  • Do not request Tight JPEG for 10-bit-per-channel/deep pixel formats.
  • Reuse the helper for both explicit tight encoding requests and the default encoding list.

Validation

Tested with a minimal local CMake configuration:

cmake -S . -B build-695-patch \
  -DWITH_EXAMPLES=OFF \
  -DWITH_TESTS=ON \
  -DWITH_OPENSSL=OFF \
  -DWITH_GNUTLS=OFF \
  -DWITH_GCRYPT=OFF \
  -DWITH_SDL=OFF \
  -DWITH_GTK=OFF \
  -DWITH_QT=OFF \
  -DWITH_FFMPEG=OFF \
  -DWITH_XCB=OFF \
  -DWITH_LIBSSHTUNNEL=OFF \
  -DWITH_SYSTEMD=OFF \
  -DCMAKE_BUILD_TYPE=Debug
cmake --build build-695-patch --parallel 1
ctest --test-dir build-695-patch --output-on-failure

Result:

100% tests passed, 0 tests failed out of 5

Notes

I could not run the original WayVNC HDR setup locally, so this should still be runtime-verified against the reported 10-bit framebuffer case.

Closes #695.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tight decoding of 10-bit-per-pixel HDR framebuffer fails

2 participants