I found this, might better help shed light on why 4chan does not support JPGs encoded with mozjpg.
https://dev.exiv2.org/projects/exiv2/wiki/The_Metadata_in_JPEG_files
Normal huffman table:
FFC4 001F 00
00 01 05 01 01 01 01 01 01 00 00 00 00 00 00 00
00 01 02 03 04 05 06 07 08 09 0A 0B
Optimized huffman table:
FFC4 001B 00
00 03 01 01 01 01 01 01 00 00 00 00 00 00 00 00
00 01 02 03 04 05 06 07 08 09
The first table has 12 symbols and the second has 10. This is 100% compliant with the JPG spec, defined by the DHT (define huffman table). Maybe older JPG encoders ignore DHT? In the cjpegli encoder you'll find this:
--fixed_code
Disable Huffman code optimization. Must be used together with -p 0.
-p N, --progressive_level=N
Progressive level setting. Range: 0 .. 2.
Default: 2. Higher number is more scans, 0 means sequential.
I'll test a jpegli encoded JPG upload with this. File size before upload: 255 KB (261,874 bytes)