mozjpeg icon indicating copy to clipboard operation
mozjpeg copied to clipboard

Possible regression in jpegtran 3.4.0 for custom scan script

Open muelleme opened this issue 6 years ago • 4 comments

Hi,

I came across some very weird behaviour using jpegtran in mozjpeg version 3.4.0 (build 20190114) (built from source).

If I use -scans to transform a baseline JPEG into a progressive one, and my scan script contains a scan performing spectral selection including exactly the first 16 AC coefficients (for any channel), then jpegtran fails with Missing Huffman code table entry on literally every image I tested.

Here is a scan script to reproduce:

0 1 2: 0 0 0 0;
0: 1 16 0 0;
0: 17 63 0 0;
1: 1 63 0 0;
2: 1 63 0 0;

Invocation of jpegtran to reproduce:

$ jpegtran -copy all -scans test.scan lena10.jpg > /dev/null
Missing Huffman code table entry

Replacing the 16 with any other number seems to fix the issue. The same scan script works fine with mozjpeg version 3.3.1 (build 20190105) (installed with homebrew).

muelleme avatar Feb 19 '19 10:02 muelleme

Same with libjpeg-turbo (I tried version 2.0.2)

kkopachev avatar Feb 22 '19 17:02 kkopachev

Could you file a bug in libjpeg-turbo?

kornelski avatar Feb 24 '19 18:02 kornelski

Opened an issue for libjpeg-turbo: https://github.com/libjpeg-turbo/libjpeg-turbo/issues/335

muelleme avatar Feb 25 '19 10:02 muelleme

This is fixed upstream.

ValZapod avatar Jul 06 '21 22:07 ValZapod

Should be fixed now

MegaByte avatar Aug 29 '23 08:08 MegaByte