Vivian Fang
7844815bd7
Add opt-in prompt image sanitization ( #61341 )
...
## What changed
- Add the disabled-by-default `safe_image_decoder` feature to decode and re-encode prompt images without source metadata, with byte and decoded-pixel limits.
- Apply JPEG orientation and supported ICC color conversion to sRGB, emitting PNG for PNG/GIF inputs and JPEG for JPEG/WebP inputs.
- Use the selected decoder for image preparation, `view_image` validation, and MCP image validation. Include the decoder in image cache keys.
- Preserve original inline images in history metadata so resume and fork can regenerate prepared images without repeated JPEG encoding changing their bytes.
## Testing
Add regression tests for identical JPEG replay after history serialization and for preventing legacy cache entries from bypassing sanitization.
GitOrigin-RevId: 718cd83d0a233e2eb8efd1a64c14d8944e44c350
2026-11-13 18:44:31 +00:00
..
2026-11-12 17:31:24 +00:00
2026-11-12 23:51:52 +00:00
2026-11-12 22:41:50 +00:00
2026-11-05 16:08:23 +00:00
2026-11-13 04:51:06 +00:00
2026-11-13 07:35:46 +00:00
2026-11-12 23:08:59 +00:00
2026-11-10 01:31:19 +00:00
2026-11-13 18:44:31 +00:00
2026-11-10 11:17:06 +00:00
2026-11-07 10:41:36 +00:00
2026-11-02 17:05:56 +00:00
2026-11-04 00:19:12 +00:00
2026-11-07 10:41:36 +00:00
2026-11-13 04:48:28 +00:00
2026-11-05 22:03:29 +00:00
2026-11-13 07:35:46 +00:00
2026-11-12 21:03:47 +00:00
2026-11-05 04:25:19 +00:00
2026-11-05 05:09:32 +00:00
2026-11-05 05:09:32 +00:00
2026-11-12 16:38:13 +00:00
2026-11-12 16:38:13 +00:00
2026-11-12 23:51:52 +00:00
2026-11-12 23:51:52 +00:00
2026-11-13 05:04:45 +00:00
2026-11-13 04:51:06 +00:00
2026-11-13 08:25:41 +00:00
2026-11-10 03:02:25 +00:00
2026-11-13 01:08:55 +00:00
2026-11-07 05:59:44 +00:00
2026-11-13 18:44:31 +00:00
2026-11-12 22:43:14 +00:00
2026-11-13 08:25:41 +00:00
2026-11-12 23:51:52 +00:00
2026-11-03 23:49:01 +00:00
2026-11-03 04:08:59 +00:00
2026-11-13 04:51:06 +00:00
2026-11-13 18:42:34 +00:00
2026-11-05 04:25:19 +00:00
2026-11-12 23:51:52 +00:00
2026-11-05 00:55:46 +00:00
2026-11-13 07:35:46 +00:00
2026-11-12 23:51:52 +00:00
2026-11-13 18:44:31 +00:00
2026-11-11 19:16:19 +00:00
2026-11-06 00:37:27 +00:00
2026-11-10 08:52:35 +00:00
2026-11-10 21:58:49 +00:00
2026-11-12 21:40:00 +00:00
2026-11-13 18:44:31 +00:00
2026-11-10 03:02:25 +00:00
2026-11-13 05:16:33 +00:00
2026-11-12 04:32:34 +00:00
2026-11-13 04:50:31 +00:00
2026-11-12 23:53:50 +00:00
2026-11-13 04:36:03 +00:00
2026-11-12 22:41:50 +00:00
2026-11-02 20:34:35 +00:00
2026-11-12 19:43:12 +00:00
2026-11-06 04:24:04 +00:00
2026-11-09 16:37:22 +00:00
2026-11-13 01:43:44 +00:00
2026-11-13 18:42:34 +00:00
2026-11-12 23:08:59 +00:00
2026-11-13 00:29:24 +00:00
2026-11-13 18:44:31 +00:00
2026-11-11 18:58:21 +00:00
2026-11-12 04:32:34 +00:00
2026-11-12 21:03:15 +00:00
2026-11-13 18:43:21 +00:00
2026-11-07 10:41:36 +00:00
2026-11-13 06:39:52 +00:00
2026-11-12 23:51:52 +00:00
2026-11-04 23:46:52 +00:00
2026-11-12 23:51:52 +00:00
2026-11-06 17:47:31 +00:00
2026-11-13 18:43:58 +00:00
2026-11-13 05:06:18 +00:00
2026-11-13 00:28:10 +00:00
2026-11-13 18:43:58 +00:00
2026-11-11 06:41:15 +00:00
2026-11-13 06:07:04 +00:00
2026-11-12 00:44:27 +00:00
2026-11-13 18:44:31 +00:00
2026-11-12 23:51:52 +00:00
2026-11-12 23:51:52 +00:00
2026-11-03 15:02:57 +00:00
2026-11-12 05:21:30 +00:00
2026-11-13 01:31:24 +00:00
2026-11-12 23:53:50 +00:00
2026-11-13 18:44:31 +00:00
2026-11-12 23:53:50 +00:00
2026-11-12 17:31:24 +00:00
2026-11-12 23:51:52 +00:00