c2patool icon indicating copy to clipboard operation
c2patool copied to clipboard

JPEG image with C2PA Manifest Store inserted before the end marker (0xFFD9) is not being validated by c2patool

Open SoftAvocado opened this issue 2 years ago • 1 comments

Expected Behaviour

c2patool should be able to verify a JPEG image with embedded the APP11 segment of C2PA Manifest Store inserted before the end marker (0xFFD9), because there're no restrictions on where to insert an APP11 segment as far as it is placed between start (0xFFD8) and end markers (0xFFD9) and doesn't interfere with other segments.

Actual behavior

c2patool cannot find claim of such image:

c2patool invalid_image_c2pa_before_ffd9.jpg
Error: No claim found

Version

c2patool --version
c2patool 0.6.1

SoftAvocado avatar Aug 22 '23 05:08 SoftAvocado

As I understand the JPEG standard (itu-t81), an APP block cannot appear in the image stream (ffda to ffd9). The image stream can only contain restart tags (ffd0 - ffd7) and for some encoding methods (e.g., progressive and sequential) it can contain multiple SOS, DHT, etc. but not APP blocks.

APP blocks are supposed to appear between the SOI (ffd8) and SOS (ffda).

See: https://www.w3.org/Graphics/JPEG/itu-t81.pdf section B.2.1.

hackerfactor avatar Oct 23 '23 13:10 hackerfactor