A long image is the simplest way to post a set of photos as one thing: a trip, a recipe, a product from every angle. Stack the photos top to bottom, export one file, done. The first version most of us write is also simple: load every photo as a UIImage , add up the heights, draw them into a UIGraphicsImageRenderer , save.
It works on the simulator with five screenshots. Then someone picks twelve 48-megapixel photos, two of them shot sideways, and the app either dies or produces a 9,000 × 60,000 pixel file that no social app will show at full size.
I build BatchMark, an on-device photo app for iPhone, and its Photo Stories feature joins a set of finished photos into one long image. This post is a teaching extract of the problems you hit when you build that kind of stitcher, not the app's source.…