From 99781bb329ae8661cf4dcc028b0a9c29ac93e133 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 19 Nov 2026 17:10:00 -0800 Subject: [PATCH] Links: Relink and folder Unembed no longer refuse a distorted image The refusals that ran before the files were read and before a folder was written stopped Relink and the folder form of Unembed on an image changed by Perspective Distort or Free Distort, which now keep their corners. --- crates/engine/src/cmd/links.rs | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/crates/engine/src/cmd/links.rs b/crates/engine/src/cmd/links.rs index 2af260011a..9d0a0bbcb3 100644 --- a/crates/engine/src/cmd/links.rs +++ b/crates/engine/src/cmd/links.rs @@ -2136,9 +2136,6 @@ fn relink(s: &mut Session, p: &Value) -> Result { _ => None, }) }; - // Whether the images were found as the missing links (nothing selected, a folder given) rather - // than named or selected. - let mut found_missing = false; let mut ids: Vec = match (&each, ids_param(p, "ids", C)?) { (Some(each), _) => each.iter().flat_map(|(ids, _)| ids.iter().copied()).collect(), (None, Some(ids)) => ids, @@ -2146,7 +2143,6 @@ fn relink(s: &mut Session, p: &Value) -> Result { let selected: Vec = st.selection.objects.iter().copied().filter(|id| image(id).is_some()).collect(); match folder_param { Some(_) if selected.is_empty() => { - found_missing = true; groups(&st.doc, None).into_iter().filter(|g| probe(g, LinkBase::of(st)).0 == Status::Missing).flat_map(|g| g.ids).collect() } _ => selected, @@ -2159,11 +2155,6 @@ fn relink(s: &mut Session, p: &Value) -> Result { if ids.is_empty() { return Err(bad(C, "select the images to relink, or pass ids")); } - // A named or selected distorted image is refused before a folder is searched, whether or not - // its file is found there. - if !found_missing && let Some(id) = ids.iter().find(|id| stored(&doc, **id).is_some_and(Node::is_distorted_image)) { - return Err(super::xform::distorted_image_error(C, *id)); - } // All Instances: the other stored objects linked to the same files, each once. if scope == Scope::All { let paths: BTreeSet<&str> = ids.iter().filter_map(|id| image(id).flatten()).map(|l| l.path.as_str()).collect(); @@ -2868,9 +2859,6 @@ fn unembed_to_folder(s: &mut Session, p: &Value, ids: Option>) -> Re skipped.push(id); continue; } - if n.is_distorted_image() { - return Err(super::xform::distorted_image_error(C, id)); - } let blob = st.doc.images.get(&im.key).filter(|b| !b.is_proxy()).ok_or_else(|| bad(C, "the image's pixels aren't in the document"))?; embedded.push((id, n.display_name(), blob)); }