From 7ca34c522dca3c1d77ba20c02026699e4ae39411 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 7 Nov 2026 15:49:34 -0800 Subject: [PATCH] .ai save: the large-canvas warning names every effect the editing copy leaves out On a large canvas no art style is written, so objects with live effects keep only their geometry effects in the editing data for other apps: blurs are left out as well as shadows, glows and feathers. The warning now says that no art styles are written and that only geometry effects are kept. The comment on rgb_without_cmyk in art_styles_write_the_same_bytes_again now gives the cause of the Windows difference: the Generic CMYK separation of the default Pink swatch, at the edge of the press gamut, lands on C0 M93.9 Y16.3 or C0 M93.2 Y15.3 when its RGB changes in the last float bits, and the platform's float math decides which. The comment also says that named and spot RGB colors are not blanked. --- crates/eps/src/ai_editing/tests.rs | 12 +++++++----- crates/eps/src/ai_editing/writer/styles.rs | 3 ++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/crates/eps/src/ai_editing/tests.rs b/crates/eps/src/ai_editing/tests.rs index a26463c96..f501555d8 100644 --- a/crates/eps/src/ai_editing/tests.rs +++ b/crates/eps/src/ai_editing/tests.rs @@ -5581,11 +5581,13 @@ fn art_styles_write_the_same_bytes_again() { near_lines(&rgb_without_cmyk(&shown(&again)), &rgb_without_cmyk(&shown(&first.program))); } -/// `program` with the CMYK equivalents of RGB colors blanked out: the first four numbers of an RGB -/// color's `c m y k r g b Xa` (or `XA`) and of an RGB gradient stop's `c m y k r g b 2 ... Bs`. A -/// save of the reopened file computes them again from the RGB values read back at four decimals, -/// and on some platforms the CMYK conversion moves them by more than [`near_lines`] allows. The RGB -/// values stay compared. +/// `program` with the CMYK equivalents of plain RGB colors blanked out: the first four numbers of +/// `c m y k r g b Xa` (or `XA`) and of an RGB gradient stop's `c m y k r g b 2 ... Bs`. Named and +/// spot RGB colors (`... (name) tint Xk`, `Xx` and spot stops) are not blanked; the document this +/// is used on has none. The Generic CMYK separation of a color at the edge of the press gamut can +/// land on one of two results that differ by up to 0.01 when the RGB changes in its last float +/// bits, as it does between the first save and the save of the reopened file, and the platform's +/// float math decides which. The RGB values stay compared. fn rgb_without_cmyk(program: &str) -> String { let blank = |line: &str| { let (prefix, rest) = line.strip_prefix("%_").map_or(("", line), |r| ("%_", r)); diff --git a/crates/eps/src/ai_editing/writer/styles.rs b/crates/eps/src/ai_editing/writer/styles.rs index ffd4b4fcf..8307ea302 100644 --- a/crates/eps/src/ai_editing/writer/styles.rs +++ b/crates/eps/src/ai_editing/writer/styles.rs @@ -18,7 +18,8 @@ use super::{Writer, Xy, blend_code, compound_path, hide}; use crate::ai_ops; use crate::ps; -pub(in crate::ai_editing) const LARGE_CANVAS_STYLES: &str = "on a large canvas, objects with live effects are written as their vector art with their geometry effects applied, without shadows, glows or feathers, in the editing data for other apps"; +pub(in crate::ai_editing) const LARGE_CANVAS_STYLES: &str = + "on a large canvas, no art styles are written: objects with live effects keep only their geometry effects in the editing data for other apps"; pub(in crate::ai_editing) const GRAPHIC_STYLES: &str = "graphic styles and links to them are left out of the editing data for other apps"; /// Does `doc` have graphic styles other than a new document's, or an object in its layers, opacity