def add_app2(jpeg_path, out_path, payload_bytes): # Read the original JPEG as raw bytes with open(jpeg_path, 'rb') as f: data = f.read()