Closed pohhsu closed 2 months ago
Very easy to replicate. You are correct that it fails to validate.
We've opened up the following issue in the jfifdump repo: https://github.com/vstroebel/jfifdump/issues/6. Will look into opening a PR if that issue fails to get traction.
Issue is fixed in latest c2p-rs main branch. I will update this issue when we recreate a new c2patool release.
Fixed 0.9.6
running latest c2patool (0.6.2) on this jpg image
failed with
This is image is attached.
Note that this is okay with 0.6.0.
Debugged into this a bit, it seems that the latest c2patool integrated jfifdump library (commit 9023ce53a52ee4bccd62c8f634b27c95b6257cbb in c2pa-rs on Oct 4).
The library will error out when the length of a marker is '2' (i.e. corresponds data segment is of length 0), see code here
https://github.com/vstroebel/jfifdump/blob/main/jfifdump/src/reader.rs line 64
But from JPEG spec, length = 2 is legal for APPn box (see B.2.4.6 of ISO+IEC+10918-1-1994.pdf), so it seems that jfifdump should be modified to use