Hi Alan,
You're correct, the PeaceWorks plugin won't solve your use case - I just thought it might be useful for you to see how others have manipulated related areas of the code, and share something you might choose to build on if it helps in other ways.
Regarding where the uploads are written to disk, I think you will want to look at these files:
I believe the first is for linking a single digital object, and the second is the form controller process that relates to uploading multiple digital objects as children of the target description.
However, one warning about modifying these directly:
Right now digital object linking and multi-object upload are both handled synchronously in real time, via the browser. This means that these processes are already susceptible to browser timeout limits that can abort the upload process and lead to errors, especially in cases where too large a DO is uploaded, or in the case of the mutli-upload, too many objects are added at once for the child information objects to be created and the uploads saved to disk before the browser's (generally default) 1 minute timeout limit is reached.
If you add further processing here, this will add further to the amount of steps to be completed, which could make the entire digital object module more susceptible to timeouts overall.
As a long-term goal, we would love to begin handling digital object linking and upload asynchronously in the background, using the Job scheduler. However, this will require further development for us to be able to implement. As a community driven project maintained by a small company that makes all of our primary resources freely available, we rely on community support (in the form of development sponsorship or community-submitted pull requests) to enhance AtoM. You can read more about our development philosophy and business model
here.
Rather than tackling an overhaul of the entire upload process, it may be possible to develop a smaller asynchronous job that iterates over uploaded digital objects and applies the watermark to the master after the upload is complete. In that case, you may want to look at previous commits and pull requests that add new jobs for reference. You can also see the existing Jobs in the code
here.
I hope that helps!