Only check DHT marker for libjpeg-turbo by radarhere · Pull Request #9025 · python-pillow/Pillow

Resolves #9024

The issue found that with libjpeg, rather than libjpeg-turbo, a test checking for a DHT marker is not found.

From https://en.wikipedia.org/wiki/JPEG, a DHT marker is

Define Huffman Table(s)

and it

Specifies one or more Huffman tables.

From https://github.com/libjpeg-turbo/libjpeg-turbo,

libjpeg-turbo can still outperform libjpeg by a significant amount, by virtue of its highly-optimized Huffman coding routines

It doesn't seem unreasonable that libjpeg-turbo would have different output regarding Huffman tables.

This PR skips checking that marker if libjpeg-turbo is not used.