Batch Processing

A Metadata-Preserving Watermark Pipeline for Evidence Photos: Pre-Extraction, Orientation Awareness, Rewrite-Back, and Three-Level Fallback

1360 words · ~7 min read
0 views

This is an image-processing pipeline note, scoped to server-side batch watermarking of field evidence photos. Method names and step numbers correspond to a working implementation; organization, customer, and deployment details are omitted. The subject is preserving metadata and orientation and keeping batches reliable, not the business rules of watermark content or delivery workflow.

The conclusion first: metadata preservation cannot be an “overall copy-back” after processing; it must be a second channel running through the entire pipeline. Three judgments up front: 1) a conventional decode-draw-encode flow outputs re-encoded pixel data, and EXIF metadata, a structure inside the JPEG APP1 marker segment, is not carried along with pixels automatically[1][3]; 2) orientation correction must happen before watermark drawing, otherwise the watermark lands on the wrong pixel orientation and copying metadata back afterward cannot fix the misplaced content; 3) in batch processing, one image aborting the whole batch costs more than one failed image, so the fallback chain must be designed for “never interrupt,” not for “throw correctly.”