ENH: Remove old bundled itkjpeg, use only libjpeg-turbo#6153
ENH: Remove old bundled itkjpeg, use only libjpeg-turbo#6153blowekamp merged 1 commit intoInsightSoftwareConsortium:mainfrom
Conversation
The ITK_USE_JPEG_TURBO option was always ON by default. Remove the option and the old bundled libjpeg (JPEG-8b-based) source tree. libjpeg-turbo 3.0.4 is now the sole bundled JPEG implementation. ITK_USE_SYSTEM_JPEG is unchanged and still supported.
dzenanz
left a comment
There was a problem hiding this comment.
When was libjpeg-turbo added? Was it added during 5.x or only after we started 6.0 development?
It was with 8181c07 in Nov 2025. So it has only been with v6. There is the feature of supporting using both as system libraries, and then maintaining both in the third-party libraries. These can be considered independently. |
|
@thewtex @hjmjohnson Any thoughts on removing the older, and non-updated jpeg library so we are only maintaining one and distributing libjpeg-turbo? |
|
+1 for just maintaining one, libjpeg-turbo. |
|
| Filename | Overview |
|---|---|
| Modules/ThirdParty/JPEG/CMakeLists.txt | Removes the ITK_USE_JPEG_TURBO option; ITK_USE_SYSTEM_JPEG path is unchanged. |
| Modules/ThirdParty/JPEG/src/CMakeLists.txt | Replaces the if/else block with an unconditional add_subdirectory(itkjpeg-turbo). |
| Modules/ThirdParty/JPEG/src/itk_jpeg.h.in | Removes the ITK_USE_JPEG_TURBO cmakedefine and collapses the three-way include into a clean two-way (system vs turbo) branch. |
| Modules/ThirdParty/JPEG/src/itkjpeg/CMakeLists.txt | Deleted as part of the legacy itkjpeg source tree removal. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[CMake configure ITKJPEG] --> B{ITK_USE_SYSTEM_JPEG?}
B -- Yes --> C[find_package JPEG\nsystem libjpeg]
B -- No --> D[add_subdirectory itkjpeg-turbo\nbundled libjpeg-turbo 3.0.4]
C --> E[itk_jpeg.h: include jpeglib.h / jerror.h]
D --> F[itk_jpeg.h: include itkjpeg-turbo/jpeglib.h / jerror.h]
Reviews (1): Last reviewed commit: "ENH: Remove old bundled itkjpeg, use onl..." | Re-trigger Greptile
Remove the old bundled libjpeg (JPEG-8b-based) source tree and the
ITK_USE_JPEG_TURBOoption. libjpeg-turbo 3.0.4 is now the solebundled JPEG implementation.
ITK_USE_SYSTEM_JPEGis unchanged.The
ITK_USE_JPEG_TURBOoption wasONby default; this changeremoves the dead code path and ~37,600 lines of the legacy source tree.
Changes
Modules/ThirdParty/JPEG/CMakeLists.txt— removedoption(ITK_USE_JPEG_TURBO ...)Modules/ThirdParty/JPEG/src/CMakeLists.txt— replacedif/elsewith unconditionaladd_subdirectory(itkjpeg-turbo)Modules/ThirdParty/JPEG/src/itk_jpeg.h.in— simplified three-way include to two-way (system vs. turbo)Modules/ThirdParty/JPEG/src/itkjpeg/— deleted entire old source directoryAI assistance
cmake --preset release --freshconfigured without errors;cmake --build --preset default --target ITKIOJPEGcompiled libjpeg-turbo sources and linked successfully