I was just looking through the updated code with sirsc_image_processed and sirsc_attachment_images_processed hooks.
As mentioned, the latter is the one I would prefer to use, but it doesn’t seem to run in all cases.
Particularly, if someone just runs a regen for one size, it appears that sirsc_image_processed is the one which runs.
So, we could hook onto both, but it looks like when someone regenerates a particular size for ALL attachments, then both hooks run, and that would end up with duplicate effort and race conditions.
Since the batch/bulk processor runs both hooks, would it be acceptable to have both hooks run in the other case also, where it’s doing regen for one size for one attachment?
For reference, I’m specifically looking at the expose_image_after_processing() function. I’m also wondering if sirsc_image_processed needs to be run by the expose_image_after_processing() function, since it calls make_images_if_not_exists() which triggers that same hook via process_single_size_from_file().
Perhaps expose_image_after_processing() should ONLY be triggering sirsc_attachment_images_processed?