With some additional debug logging (https://github.com/nico/serenity/pull/new/jpeg-debug):
% Build/lagom/bin/image -o out.png image-0024.jpg
JPEG: trying to read marker at 0x1000
JPEG: trying to read marker at 0x1002
JPEG: trying to read marker at 0x1014
JPEG: trying to read marker at 0x1035
JPEG: trying to read marker at 0x107a
JPEG: trying to read marker at 0x1131
JPEG: trying to read marker at 0x1176
JPEG: trying to read marker at 0x1197
JPEG: trying to read marker at 0x124e
Restart marker: 1760
JPEG: trying to read marker at 0x1254
Component subsampling: 2, 2
Component subsampling: 1, 1
Component subsampling: 1, 1
Image width: 3507
Image height: 2480
Macroblocks in a row: 440
Macroblocks in a column: 310
Macroblock meta padded total: 136400
JPEG: trying to read marker at 0x1267
SOS Bytes to read: 10
Components in scan: 1 2 3
Start of Selection: 0, End of Selection: 63, Successive Approximation High: 0, Successive Approximation Low: 0
Restarting decoder at macroblock 7040, offset 0x33bf
Restarting decoder at macroblock 14080, offset 0x6d55
Restarting decoder at macroblock 21120, offset 0xe91c
Restarting decoder at macroblock 28160, offset 0x161c7
Restarting decoder at macroblock 35200, offset 0x1db6a
Restarting decoder at macroblock 42240, offset 0x258d0
Restarting decoder at macroblock 49280, offset 0x2d5be
Restarting decoder at macroblock 56320, offset 0x352c1
Restarting decoder at macroblock 63360, offset 0x3ca24
Restarting decoder at macroblock 70400, offset 0x45035
Restarting decoder at macroblock 77440, offset 0x4c5a8
Restarting decoder at macroblock 84480, offset 0x538d3
Restarting decoder at macroblock 91520, offset 0x5aa12
Restarting decoder at macroblock 98560, offset 0x61c59
Restarting decoder at macroblock 105600, offset 0x68a80
Restarting decoder at macroblock 112640, offset 0x6f462
Restarting decoder at macroblock 119680, offset 0x75cdb
Restarting decoder at macroblock 126720, offset 0x7a04b
Restarting decoder at macroblock 133760, offset 0x7c06f
JPEG: trying to read marker at 0x7cac6
JPEG: Unsupported marker 0x0028 before offset 0x7cac8
Runtime error: Reached an unsupported marker
Looks like there's some trailing data (…or we read to little data) before the JPEG_EOI
after we're done with decode_huffman_stream()
.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too