Skip to content

Add USE_LIBJPEG_TURBO option - #273

Merged
danoli3 merged 2 commits into
masterfrom
feat/libjpeg-turbo-option
Nov 9, 2026
Merged

danoli3 merged 2 commits into
masterfrom
feat/libjpeg-turbo-option

Conversation

@danoli3

@danoli3 danoli3 commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Adds an opt-in USE_LIBJPEG_TURBO option (default OFF) that uses an installed libjpeg-turbo through its libjpeg-compatible API instead of the bundled IJG libjpeg.

  • Configure fails clearly if the found libjpeg is not libjpeg-turbo (header/library check) or if BUILD_LIBJPEG=OFF.
  • The installed CMake package calls find_dependency(JPEG) for external JPEG builds.
  • Lossless JPEG transforms (transupp) are unavailable with an external JPEG library; the configure output says so and the README documents it. testJPEG.cpp now exercises the codec independently of those helpers.
  • New libjpeg-turbo CI job (static and shared): build, test, install, and build/run the installed-package smoke consumer.

Tested on macOS with Homebrew libjpeg-turbo 3.2.1: configure, build and 19/19 CTest tests pass, and USE_LIBJPEG_TURBO=ON with BUILD_LIBJPEG=OFF errors as intended. On this machine a stray jpeglib.h in Mono.framework was found first, and the header check correctly rejected it until JPEG_INCLUDE_DIR was set, which is the case the check exists for. The installed-package smoke consumer links here only with the project(... C CXX) change from #272; on current master that project is C-only. The Linux CI job is the first run of the new workflow.

Add an opt-in USE_LIBJPEG_TURBO CMake option that links an installed libjpeg-turbo through its libjpeg-compatible API instead of the bundled IJG libjpeg. Configure fails with a clear message if the found library is not libjpeg-turbo, or if BUILD_LIBJPEG is OFF. The installed package finds JPEG as a dependency, and the JPEG codec is tested independently of the lossless-transform helpers, which are unavailable with an external JPEG library. Add a libjpeg-turbo CI job (static and shared) that also installs and consumes the package, and document the option.
@danoli3
danoli3 force-pushed the feat/libjpeg-turbo-option branch from 7c7ce51 to 0061895 Compare November 9, 2026 10:22
@danoli3
danoli3 merged commit f5bfc09 into master Nov 9, 2026
99 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant