Subclasses of core image effects are signed as c2pa.unknown
Part of #3596034 (closed).
Problem/Motivation
c2pa_sign_image_style_effect_to_action() matches effects by exact class name. Core's AvifImageEffect (image_convert_avif) extends ConvertImageEffect, so it falls to the default branch and the derivative is signed with c2pa.unknown instead of c2pa.converted. Any effect that extends one of the mapped classes gets the same result.
Steps to reproduce
- Add an image style with the "Convert to AVIF" effect.
- Turn on signing of image derivatives and request a derivative.
- Run
c2patoolon it. The action isc2pa.unknown.
Proposed resolution
Keep the switch as it is. In the default branch, after the c2paAction() check, test instanceof against the mapped core classes before falling back to c2pa.unknown. c2pa_sign_implements_or_is() cannot do this: it checks the exact class and the interfaces, not the parent classes.
Definition of done
- AVIF conversion is signed as
c2pa.converted - Effects with
c2paAction()keep their action - Unmapped effects still get
c2pa.unknown
AI Compliance
🤖 Generated with the help of an LLM, reviewed and approved by me before posting.