The obvious first version of batch watermark code has one setting that looks completely reasonable: a font size of 48.
On a screenshot that's enormous. On a 48-megapixel photo it's a speck in the corner you'd need to zoom in to find. On a portrait photo it sits at a different distance from the edge than on a landscape one. Every photo in the batch gets "the same" watermark, and no two of them look alike.
The bug isn't in any single line. It's the idea that a watermark has a size in points. When you're stamping a mixed set of images (phone photos, screenshots, crops, panoramas, images saved from chat apps), the only size that means anything is a size relative to the image. This post shows how to set that up in Swift with UIKit drawing, plus the few traps that are easy to miss.
The mixed set you actually get
If you let people pick photos from their library, assume the batch looks something like this:
4032 × 3024 (12 MP, landscape)
3024 × 4032 (the same camera, portrait)
Discussion
Leave the first comment
Be the first to leave a mark on this discussion.