Image style actions carry a non-ISO when and lose the effect description
Part of #3596034 (closed).
Problem/Motivation
c2pa_sign_image_style_effect_to_action() builds every action of a signed derivative with 'when' => '0(' . date('c', ...) . ')', and puts the effect text in metadata. c2patool 0.28.2 keeps when as written, which is not a date. It drops metadata without an error, because the actions schema has no such field. A derivative signed through an effect that implements c2paMetadata() ends up with:
{"action":"c2pa.edited","when":"0(2026-10-20T17:10:20+02:00)"}Nothing in the signed file says what the effect did.
Steps to reproduce
- Turn on signing of image derivatives.
- Request a derivative of a style with a Scale effect.
- Run
c2patoolon the derivative.
Proposed resolution
Write when as date('c', ...). Add description, filled only from c2paMetadata(), never from the fallback text that carries the effect configuration. Keep metadata as it is: modules such as ai_disclosure_image read it before signing.
Definition of done
-
whenis an ISO 8601 date -
descriptionis set only when the effect provides a text -
metadatais unchanged
Testing instructions
Repeat the steps with c2patool 0.27.22 and 0.28.2. The actions carry an ISO when.
AI Compliance
🤖 Generated with the help of an LLM, reviewed and approved by me before posting.