From 5ffe485da121ef499eaf4b8a75b40a87f845acd8 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 16 Nov 2026 08:45:01 -0800 Subject: [PATCH] Links: Unembed takes ids of one image as id links.unembed now reads `ids` of one image as `id`, and `id` with `folder` as `ids` of that image, as the other commands that name both keys do. `id` with `ids`, and `path` with `folder`, are refused with the shared "give `a` or `b`, not both" error, in a replayed step too, and the catalog rows for the old combined message are removed. --- crates/engine/src/cmd/links.rs | 30 +++++++++++++++++---------- crates/engine/src/cmd/params.rs | 9 ++++++-- crates/engine/src/tests/linkspanel.rs | 20 ++++++++++++++---- crates/ui-egui/src/i18n/ca.tsv | 1 - crates/ui-egui/src/i18n/cs.tsv | 1 - crates/ui-egui/src/i18n/da.tsv | 1 - crates/ui-egui/src/i18n/de.tsv | 1 - crates/ui-egui/src/i18n/el.tsv | 1 - crates/ui-egui/src/i18n/es.tsv | 1 - crates/ui-egui/src/i18n/fi.tsv | 1 - crates/ui-egui/src/i18n/fr.tsv | 1 - crates/ui-egui/src/i18n/hi.tsv | 1 - crates/ui-egui/src/i18n/hu.tsv | 1 - crates/ui-egui/src/i18n/it.tsv | 1 - crates/ui-egui/src/i18n/ja.tsv | 1 - crates/ui-egui/src/i18n/ka.tsv | 1 - crates/ui-egui/src/i18n/ko.tsv | 1 - crates/ui-egui/src/i18n/nl.tsv | 1 - crates/ui-egui/src/i18n/pl.tsv | 1 - crates/ui-egui/src/i18n/pt-br.tsv | 1 - crates/ui-egui/src/i18n/ru.tsv | 1 - crates/ui-egui/src/i18n/sv.tsv | 1 - crates/ui-egui/src/i18n/tr.tsv | 1 - crates/ui-egui/src/i18n/uk.tsv | 1 - crates/ui-egui/src/i18n/vi.tsv | 1 - crates/ui-egui/src/i18n/zh-hans.tsv | 1 - crates/ui-egui/src/i18n/zh-hant.tsv | 1 - docs/mcp.md | 6 ++++-- 28 files changed, 46 insertions(+), 43 deletions(-) diff --git a/crates/engine/src/cmd/links.rs b/crates/engine/src/cmd/links.rs index 0c31b968e3..aae161f12d 100644 --- a/crates/engine/src/cmd/links.rs +++ b/crates/engine/src/cmd/links.rs @@ -108,7 +108,7 @@ pub fn specs() -> Vec { "Unembed", [], None, - "{id?: an embedded image (default: the one selected), path?, ids?: [image ids] (with folder; default: the selected embedded images), folder?} write the image's pixels to the file at path (PNG, JPEG, GIF or WebP as stored, other images as PNG; a path ending in .png/.jpg/.jpeg/.gif/.webp/.tif/.tiff/.bmp converts them) and link the image to it, keeping its bounds. One undo step → {id, path}; no path → {name, dataBase64} (nothing changes: there is no file to link to). Several images, with ids and folder: write each embedded image to a new file in folder, as stored (as PNG when that format is not one of VectorCraft's raster file formats), named after the image (characters a file name can't hold become _; Image when nothing is left), with Name 2 … Name 99 when the name is taken; a file already there is never replaced. Linked images among ids are left as they are. Each image links to its file and keeps its bounds. One undo step (undo does not remove the files); when a file can't be written, the files this call wrote are removed and nothing changes → {unembedded: [{id, path}], skipped: [ids of linked images]}; id or path with ids or folder is an error", + "{id?: an embedded image (default: the one selected), path?, ids?: [image ids] (instead of id; one id is the same as id), folder?} write the image's pixels to the file at path (PNG, JPEG, GIF or WebP as stored, other images as PNG; a path ending in .png/.jpg/.jpeg/.gif/.webp/.tif/.tiff/.bmp converts them) and link the image to it, keeping its bounds. One undo step → {id, path}; no path → {name, dataBase64} (nothing changes: there is no file to link to). With folder: write each embedded image of ids or id (default: the selected embedded images) to a new file in folder, as stored (as PNG when that format is not one of VectorCraft's raster file formats), named after the image (characters a file name can't hold become _; Image when nothing is left), with Name 2 … Name 99 when the name is taken; a file already there is never replaced. Linked images among ids are left as they are. Each image links to its file and keeps its bounds. One undo step (undo does not remove the files); when a file can't be written, the files this call wrote are removed and nothing changes → {unembedded: [{id, path}], skipped: [ids of linked images]}; id with ids, path with folder, and ids of more or fewer than one image without folder are errors", has_doc, unembed ), @@ -2685,15 +2685,19 @@ fn unembed_bytes(blob: &vectorcraft_doc::ImageBlob, ext: &str) -> std::result::R fn unembed(s: &mut Session, p: &Value) -> Result { const C: &str = "links.unembed"; let given = |k: &str| p.get(k).is_some_and(|v| !v.is_null()); - if given("ids") || given("folder") { - if given("id") || given("path") { - return Err(bad(C, "give id and path for one image, or ids and folder for several")); - } - return unembed_to_folder(s, p); + // `id` with `ids`, and `path` with `folder`, are refused, in a replayed step too. + super::params::check_exclusive_keys(C, p)?; + let ids = ids_param(p, "ids", C)?; + if given("folder") || ids.as_ref().is_some_and(|ids| ids.len() != 1) { + return unembed_to_folder(s, p, ids); } let st = s.doc()?; let doc = with_brush_art(&st.doc); - let id = image_param(st, &doc, p, C)?; + // `ids` of one image is `id`. + let id = match ids.as_deref() { + Some(&[id]) => id, + _ => image_param(st, &doc, p, C)?, + }; let n = stored(&doc, id).ok_or(crate::EngineError::NoNode(id))?; let im = image_of(&doc, id).ok_or_else(|| bad(C, format!("object {} is not an image", id.0)))?; if im.link.is_some() { @@ -2724,16 +2728,20 @@ fn unembed(s: &mut Session, p: &Value) -> Result { Ok(json!({ "id": id.0, "path": path })) } -/// `links.unembed {ids?, folder}`: each embedded image of `ids` (default: the selected embedded -/// images) written to a new file in `folder` as stored (as PNG when that format is not one of +/// `links.unembed {ids?, folder}`: each embedded image of `ids` (`id` as `ids` of one; default: the +/// selected embedded images) written to a new file in `folder` as stored (as PNG when that format is not one of /// VectorCraft's raster file formats) and linked to it, in one undo step. Linked images are skipped. When any image fails, the files written before it /// are removed and the document does not change. -fn unembed_to_folder(s: &mut Session, p: &Value) -> Result { +fn unembed_to_folder(s: &mut Session, p: &Value, ids: Option>) -> Result { const C: &str = "links.unembed"; let folder = text_param(p, "folder", C)?.filter(|f| !f.is_empty()).ok_or_else(|| bad(C, "missing `folder`"))?; + let ids = match ids { + Some(ids) => Some(ids), + None => object_param(p, "id", C)?.map(|id| vec![id]), + }; let st = s.doc()?; let doc = with_brush_art(&st.doc); - let ids = ids_param(p, "ids", C)?.unwrap_or_else(|| selected_images(st, |im| im.link.is_none())); + let ids = ids.unwrap_or_else(|| selected_images(st, |im| im.link.is_none())); let mut seen = BTreeSet::new(); if !ids.iter().all(|id| seen.insert(id.0)) { return Err(bad(C, "`ids` names an object twice")); diff --git a/crates/engine/src/cmd/params.rs b/crates/engine/src/cmd/params.rs index fdf7dd4b19..5ef2ba69c2 100644 --- a/crates/engine/src/cmd/params.rs +++ b/crates/engine/src/cmd/params.rs @@ -258,11 +258,16 @@ pub fn check_keys(id: &str, doc: &'static str, params: &Value) -> Result<()> { /// Parameters a command takes instead of one another: (command, key, other key). Giving both, /// neither null, is a parameter error ([`check_exclusive_keys`]). -const EXCLUSIVE_KEYS: &[(&str, &str, &str)] = &[("addon.pathtools.cornerSet", "items", "ids"), ("addon.pathtools.cornerRemove", "items", "ids")]; +const EXCLUSIVE_KEYS: &[(&str, &str, &str)] = &[ + ("addon.pathtools.cornerSet", "items", "ids"), + ("addon.pathtools.cornerRemove", "items", "ids"), + ("links.unembed", "id", "ids"), + ("links.unembed", "path", "folder"), +]; /// `params` of command `id` give at most one of each pair in [`EXCLUSIVE_KEYS`], or the parameter /// error naming the pair. -fn check_exclusive_keys(id: &str, params: &Value) -> Result<()> { +pub(crate) fn check_exclusive_keys(id: &str, params: &Value) -> Result<()> { let given = |key: &str| params.get(key).filter(|v| !v.is_null()); for (_, key, other) in EXCLUSIVE_KEYS.iter().filter(|(c, ..)| *c == id) { if given(key).is_some() && given(other).is_some() { diff --git a/crates/engine/src/tests/linkspanel.rs b/crates/engine/src/tests/linkspanel.rs index 05b7e9a405..cd844fa28d 100644 --- a/crates/engine/src/tests/linkspanel.rs +++ b/crates/engine/src/tests/linkspanel.rs @@ -253,11 +253,20 @@ fn unembed_to_a_folder_writes_each_image_and_links_it_in_one_undo_step() { run(&mut s, "edit.undo", json!({})); assert!(image(&s, a).link.is_none() && image(&s, b).link.is_none(), "both embedded again"); assert_eq!(files_in(&out).len(), 3, "undo leaves the files"); + // `ids` of one image without `folder` is `id`: the bytes, and nothing changes. + let one = run(&mut s, "links.unembed", json!({"ids": [a.0]})); + assert_eq!(one, run(&mut s, "links.unembed", json!({"id": a.0}))); + assert!(one["dataBase64"].is_string(), "{one}"); + assert!(image(&s, a).link.is_none()); // With no ids, the selected embedded images. s.doc_mut().unwrap().selection.objects = vec![b, linked]; let r = run(&mut s, "links.unembed", json!({"folder": out})); assert_eq!(r, json!({"unembedded": [{"id": b.0, "path": file_in(&out, "photo 4.png")}], "skipped": []})); assert_eq!(std::fs::read(file_in(&out, "photo 4.png")).unwrap(), blue); + // `id` with `folder` is `ids` of that one image. + let r = run(&mut s, "links.unembed", json!({"id": a.0, "folder": out})); + assert_eq!(r, json!({"unembedded": [{"id": a.0, "path": file_in(&out, "photo 5.png")}], "skipped": []})); + assert_eq!(image(&s, a).link.unwrap().path, file_in(&out, "photo 5.png")); } /// A batch that fails part way writes no file and changes nothing; requests that don't fit the @@ -285,11 +294,14 @@ fn unembed_to_a_folder_that_fails_leaves_no_file_and_no_change() { std::sync::Arc::make_mut(&mut s.doc_mut().unwrap().doc).images.insert(key, saved); let refused = |s: &mut Session, p: Value| s.execute("links.unembed", &p).unwrap_err().to_string(); - let both = "give id and path for one image, or ids and folder for several"; + let both = "give `path` or `folder`, not both"; assert!(refused(&mut s, json!({"ids": [a.0, a.0], "folder": out})).ends_with("`ids` names an object twice")); - assert!(refused(&mut s, json!({"id": a.0, "folder": out})).ends_with(both)); - assert!(refused(&mut s, json!({"ids": [a.0], "path": file_in(&out, "x.png")})).ends_with(both)); - assert!(refused(&mut s, json!({"ids": [a.0]})).ends_with("missing `folder`")); + assert!(refused(&mut s, json!({"id": a.0, "path": file_in(&out, "x.png"), "folder": out})).ends_with(both)); + assert!(refused(&mut s, json!({"ids": [a.0], "path": file_in(&out, "x.png"), "folder": out})).ends_with(both)); + assert!(refused(&mut s, json!({"ids": [a.0, b.0]})).ends_with("missing `folder`")); + assert!(refused(&mut s, json!({"ids": []})).ends_with("missing `folder`")); + assert!(refused(&mut s, json!({"id": a.0, "ids": [b.0], "folder": out})).ends_with("give `id` or `ids`, not both")); + assert!(refused(&mut s, json!({"id": a.0, "ids": [b.0]})).ends_with("give `id` or `ids`, not both")); assert!(refused(&mut s, json!({"ids": [a.0], "folder": 5})).ends_with("`folder` must be a string")); assert!(refused(&mut s, json!({"ids": [], "folder": out})).ends_with("select an image")); let file = dir.file("one.png"); diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 4884672616..c3c6aff6c7 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -6630,7 +6630,6 @@ liquify-list-end {0}, {1} {0} i {1} @msg Unembedded to {_1} S’ha desincrustat a {_1} @msgplural Unembedded {n} image to {folder}|Unembedded {n} images to {folder} S’ha desincrustat {n} imatge a {folder}|S’han desincrustat {n} imatges a {folder} @msg every numbered name for {name} is taken in that folder tots els noms numerats per a {name} estan ocupats en aquesta carpeta -@msg give id and path for one image, or ids and folder for several indiqueu id i path per a una imatge, o ids i folder per a diverses @msg unknown command `{0}` ordre desconeguda `{0}` @msg step {step} of “{action}” runs the unknown command `{command}` el pas {step} de “{action}” executa l’ordre desconeguda `{command}` @msg unknown command `{0}`; did you mean `{1}`? ordre desconeguda `{0}`; volies dir `{1}`? diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 5b8af44327..c1d5c8513a 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -5638,7 +5638,6 @@ liquify-list-end {0}, {1} {0} a {1} @msg Unembedded to {_1} Vložení zrušeno, uloženo do: {_1} @msgplural Unembedded {n} image to {folder}|Unembedded {n} images to {folder} Vložení zrušeno u {n} obrázku, uloženo do: {folder}|Vložení zrušeno u {n} obrázků, uloženo do: {folder}|Vložení zrušeno u {n} obrázků, uloženo do: {folder} @msg every numbered name for {name} is taken in that folder v této složce jsou obsazena všechna číslovaná jména pro {name} -@msg give id and path for one image, or ids and folder for several zadejte id a path pro jeden obrázek, nebo ids a folder pro více obrázků @msg Reset {_1} Obnoveno: {_1} @msg Sent to {_1} Odesláno do {_1} @msg {_1} files Soubory {_1} diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index e8aeb4acff..6aa0289414 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -7744,7 +7744,6 @@ imageTrace Outline Kontur @msg Unembedded to {_1} Fjernede indlejring til {_1} @msgplural Unembedded {n} image to {folder}|Unembedded {n} images to {folder} Fjernede indlejring af {n} billede til {folder}|Fjernede indlejring af {n} billeder til {folder} @msg every numbered name for {name} is taken in that folder alle nummererede navne til {name} er optaget i den mappe -@msg give id and path for one image, or ids and folder for several angiv id og path for ét billede, eller ids og folder for flere @msg Reset {_1} Nulstillede {_1} @msg Sent to {_1} Sendte til {_1} @msg {_1} files {_1}-filer diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 7d7dc5d181..a5f05e1137 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -5239,7 +5239,6 @@ liquify-list-end {0}, {1} {0} und {1} @msg Unembedded to {_1} Einbettung aufgehoben, gespeichert unter {_1} @msgplural Unembedded {n} image to {folder}|Unembedded {n} images to {folder} Einbettung von {n} Bild aufgehoben, gespeichert unter {folder}|Einbettung von {n} Bildern aufgehoben, gespeichert unter {folder} @msg every numbered name for {name} is taken in that folder alle nummerierten Namen für {name} sind in diesem Ordner bereits vergeben -@msg give id and path for one image, or ids and folder for several geben Sie id und path für ein Bild oder ids und folder für mehrere an @msg Reset {_1} {_1} zurückgesetzt @msg Sent to {_1} An {_1} gesendet @msg {_1} files {_1}-Dateien diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 3d779a0b98..6a5106ba79 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -5293,7 +5293,6 @@ digits Malayalam Μαλαγιάλαμ @msg Unembedded to {_1} Καταργήθηκε η ενσωμάτωση στο {_1} @msgplural Unembedded {n} image to {folder}|Unembedded {n} images to {folder} Καταργήθηκε η ενσωμάτωση {n} εικόνας στο {folder}|Καταργήθηκε η ενσωμάτωση {n} εικόνων στο {folder} @msg every numbered name for {name} is taken in that folder όλα τα αριθμημένα ονόματα για το {name} χρησιμοποιούνται ήδη σε αυτόν τον φάκελο -@msg give id and path for one image, or ids and folder for several δώστε id και path για μία εικόνα ή ids και folder για πολλές @msg Reset {_1} Επαναφορά {_1} @msg Sent to {_1} Στάλθηκε στο {_1} @msg {_1} files {_1} αρχεία diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 9d7dc87750..25fd3899dc 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -5346,7 +5346,6 @@ liquify-list-end {0}, {1} {0}, {1} @msg Unembedded to {_1} Se desincrustó en {_1} @msgplural Unembedded {n} image to {folder}|Unembedded {n} images to {folder} Se desincrustó {n} imagen en {folder}|Se desincrustaron {n} imágenes en {folder} @msg every numbered name for {name} is taken in that folder todos los nombres numerados para {name} ya existen en esa carpeta -@msg give id and path for one image, or ids and folder for several indique id y path para una imagen, o ids y folder para varias @msg Reset {_1} Se restableció {_1} @msg Sent to {_1} Se envió a {_1} @msg {_1} files {_1} archivos diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index c6f89c572b..fcd38e60ab 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -5562,7 +5562,6 @@ liquify-list-end {0}, {1} {0} ja {1} @msg Unembedded to {_1} Upotus purettiin kohteeseen {_1} @msgplural Unembedded {n} image to {folder}|Unembedded {n} images to {folder} Upotus purettiin {n} kuvalta kohteeseen {folder}|Upotus purettiin {n} kuvalta kohteeseen {folder} @msg every numbered name for {name} is taken in that folder kaikki kohteen {name} numeroidut nimet ovat jo käytössä siinä kansiossa -@msg give id and path for one image, or ids and folder for several anna id ja path yhdelle kuvalle tai ids ja folder useammalle @msg Reset {_1} Palautettiin oletukseksi {_1} @msg Sent to {_1} Lähetettiin kohteeseen {_1} @msg {_1} files {_1}-tiedostot diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 409d165561..81c20f4321 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -5304,7 +5304,6 @@ liquify-list-end {0}, {1} {0} et {1} @msg Unembedded to {_1} Incorporation annulée vers {_1} @msgplural Unembedded {n} image to {folder}|Unembedded {n} images to {folder} Incorporation annulée pour {n} image vers {folder}|Incorporation annulée pour {n} images vers {folder} @msg every numbered name for {name} is taken in that folder tous les noms numérotés pour {name} sont déjà pris dans ce dossier -@msg give id and path for one image, or ids and folder for several indiquez id et path pour une image, ou ids et folder pour plusieurs @msg Reset {_1} {_1} réinitialisé @msg Sent to {_1} Envoyé à {_1} @msg {_1} files Fichiers {_1} diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 3bdb1a8bbe..da15fe722d 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -8699,7 +8699,6 @@ liquify-list-end {0}, {1} {0} और {1} @msg Unembedded to {_1} एम्बेड हटाकर {_1} में रखा गया @msgplural Unembedded {n} image to {folder}|Unembedded {n} images to {folder} {n} इमेज का एम्बेड हटाकर {folder} में रखा गया|{n} इमेज का एम्बेड हटाकर {folder} में रखा गया @msg every numbered name for {name} is taken in that folder {name} के लिए हर नंबर वाला नाम उस फ़ोल्डर में पहले से लिया गया है -@msg give id and path for one image, or ids and folder for several एक इमेज के लिए id और path दें, या कई के लिए ids और folder दें @msg unexpected host trap होस्ट में अप्रत्याशित ट्रैप @msg unexpected resources अप्रत्याशित संसाधन @msg unknown {k} key `{key}` (size, position) अज्ञात {k} कुंजी `{key}` (size, position) diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index ae4ff60666..261fd43658 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -6031,7 +6031,6 @@ liquify-list-end {0}, {1} {0} és {1} @msg Unembedded to {_1} Beágyazás megszüntetve, ide: {_1} @msgplural Unembedded {n} image to {folder}|Unembedded {n} images to {folder} Beágyazás megszüntetve, képek: {n}, ide: {folder} @msg every numbered name for {name} is taken in that folder abban a mappában minden sorszámozott név foglalt: {name} -@msg give id and path for one image, or ids and folder for several egy képhez adja meg az id és a path, többhöz az ids és a folder értékét @msg unknown command `{0}` ismeretlen parancs: `{0}` @msg step {step} of “{action}” runs the unknown command `{command}` „{action}”, lépés: {step}: ismeretlen parancsot futtat: `{command}` @msg unknown command `{0}`; did you mean `{1}`? ismeretlen parancs: `{0}`; erre gondolt: `{1}`? diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 8b8731b54d..0354943515 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -5372,7 +5372,6 @@ liquify-list-end {0}, {1} {0} e {1} @msg Unembedded to {_1} Incorporamento rimosso, salvato in {_1} @msgplural Unembedded {n} image to {folder}|Unembedded {n} images to {folder} Incorporamento rimosso per {n} immagine, salvata in {folder}|Incorporamento rimosso per {n} immagini, salvate in {folder} @msg every numbered name for {name} is taken in that folder tutti i nomi numerati per {name} sono già usati in quella cartella -@msg give id and path for one image, or ids and folder for several indica id e path per un’immagine, oppure ids e folder per più immagini @msg Reset {_1} Reimpostato {_1} @msg Sent to {_1} Inviato a {_1} @msg {_1} files {_1} file diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 9e52214354..e8b338906e 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -5441,7 +5441,6 @@ liquify-list-end {0}, {1} {0}、{1} @msg Unembedded to {_1} 埋め込みを解除して {_1} に保存しました @msgplural Unembedded {n} image to {folder}|Unembedded {n} images to {folder} {n} 枚の画像の埋め込みを解除して {folder} に保存しました @msg every numbered name for {name} is taken in that folder そのフォルダーでは、{name} の番号付きの名前がすべて使われています -@msg give id and path for one image, or ids and folder for several 1 つの画像には id と path を、複数の画像には ids と folder を指定してください @msg no swatch library `{l}` (see swatch.library.list) スウォッチライブラリ `{l}` が見つかりません (swatch.library.list を参照) @msg no user library folder here この環境にはユーザーライブラリフォルダーがありません @msg Couldn't place {name}: the document it was dropped on was closed {name} を配置できませんでした: ドロップ先のドキュメントは閉じられています diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 1858315d79..82433a5682 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -7006,7 +7006,6 @@ font-technology Variable ცვლადი @msg Unembedded to {_1} ჩაშენება მოხსნილია: {_1} @msgplural Unembedded {n} image to {folder}|Unembedded {n} images to {folder} ჩაშენება მოხსნილია, გამოსახულებები: {n}, საქაღალდე: {folder} @msg every numbered name for {name} is taken in that folder იმ საქაღალდეში {name}-ის ყველა დანომრილი სახელი დაკავებულია -@msg give id and path for one image, or ids and folder for several ერთი გამოსახულებისთვის მიუთითეთ id და path, რამდენიმესთვის კი ids და folder @msg Reset {_1} ჩამოყრილია: {_1} @msg Sent to {_1} გაგზავნილია: {_1} @msg {_1} files ფაილები: {_1} diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index a9c2f64c34..5010f8ee79 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -5368,7 +5368,6 @@ liquify-list-end {0}, {1} {0} 및 {1} @msg Unembedded to {_1} {_1}에 포함 해제했습니다 @msgplural Unembedded {n} image to {folder}|Unembedded {n} images to {folder} 이미지 {n}개를 {folder}에 포함 해제했습니다 @msg every numbered name for {name} is taken in that folder 해당 폴더에서 {name}을(를) 위한 번호 이름이 모두 사용 중입니다 -@msg give id and path for one image, or ids and folder for several 이미지 하나에는 id와 path를, 여러 개에는 ids와 folder를 지정하세요 @msg no swatch library `{l}` (see swatch.library.list) 견본 라이브러리 `{l}`이(가) 없습니다(swatch.library.list 참조) @msg no user library folder here 여기에는 사용자 라이브러리 폴더가 없습니다 @msg Couldn't place {name}: the document it was dropped on was closed {name}을(를) 가져올 수 없습니다: 놓은 문서가 닫혔습니다 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index d62e2d58b8..bbed33fdbe 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -5638,7 +5638,6 @@ imageTrace Outline Contour @msg Unembedded to {_1} Extern gemaakt: {_1} @msgplural Unembedded {n} image to {folder}|Unembedded {n} images to {folder} {n} afbeelding extern gemaakt in {folder}|{n} afbeeldingen extern gemaakt in {folder} @msg every numbered name for {name} is taken in that folder elke genummerde naam voor {name} is al vergeven in die map -@msg give id and path for one image, or ids and folder for several geef id en path voor één afbeelding, of ids en folder voor meerdere @msg Reset {_1} {_1} opnieuw ingesteld @msg Sent to {_1} Verzonden naar {_1} @msg {_1} files {_1}-bestanden diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 290b6d7708..15e0b4faac 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -5464,7 +5464,6 @@ liquify-list-end {0}, {1} {0} i {1} @msg Unembedded to {_1} Wyodrębniono do {_1} @msgplural Unembedded {n} image to {folder}|Unembedded {n} images to {folder} Wyodrębniono {n} obraz do {folder}|Wyodrębniono {n} obrazy do {folder}|Wyodrębniono {n} obrazów do {folder} @msg every numbered name for {name} is taken in that folder wszystkie numerowane nazwy dla {name} są zajęte w tym folderze -@msg give id and path for one image, or ids and folder for several podaj id i path dla jednego obrazu albo ids i folder dla kilku @msg Reset {_1} Zresetowano {_1} @msg Sent to {_1} Wysłano do {_1} @msg {_1} files Pliki {_1} diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 9acb322df7..f169c77afd 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -4645,7 +4645,6 @@ axis Both Ambos @msg Unembedded to {_1} Desincorporado para {_1} @msgplural Unembedded {n} image to {folder}|Unembedded {n} images to {folder} {n} imagem desincorporada para {folder}|{n} imagens desincorporadas para {folder} @msg every numbered name for {name} is taken in that folder todos os nomes numerados para {name} já existem nessa pasta -@msg give id and path for one image, or ids and folder for several informe id e path para uma imagem, ou ids e folder para várias @msg Reset {_1} Redefinir {_1} @msg Sent to {_1} Enviado para {_1} @msg {_1} files {_1} arquivos diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 03e571d721..8950b4aafc 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -5370,7 +5370,6 @@ liquify-list-end {0}, {1} {0} и {1} @msg Unembedded to {_1} Извлечено в {_1} @msgplural Unembedded {n} image to {folder}|Unembedded {n} images to {folder} Извлечено {n} изображение в {folder}|Извлечено {n} изображения в {folder}|Извлечено {n} изображений в {folder} @msg every numbered name for {name} is taken in that folder все нумерованные имена для {name} уже заняты в этой папке -@msg give id and path for one image, or ids and folder for several укажите id и path для одного изображения или ids и folder для нескольких @msg Reset {_1} Сброшено: {_1} @msg Sent to {_1} Отправлено в {_1} @msg {_1} files {_1} файлов diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 2a0c199535..932164585f 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -5234,7 +5234,6 @@ liquify-list-end {0}, {1} {0} och {1} @msg Unembedded to {_1} Extraherad till {_1} @msgplural Unembedded {n} image to {folder}|Unembedded {n} images to {folder} Extraherade {n} bild till {folder}|Extraherade {n} bilder till {folder} @msg every numbered name for {name} is taken in that folder alla numrerade namn för {name} är upptagna i den mappen -@msg give id and path for one image, or ids and folder for several ange id och path för en bild, eller ids och folder för flera @msg Reset {_1} Återställ {_1} @msg Sent to {_1} Skickat till {_1} @msg {_1} files {_1}-filer diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index c348362813..5b20b2ab0c 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -5063,7 +5063,6 @@ liquify-list-end {0}, {1} {0} ve {1} @msg Unembedded to {_1} {_1}'ye gömülü değil @msgplural Unembedded {n} image to {folder}|Unembedded {n} images to {folder} {n} görselin gömülmesi kaldırıldı: {folder} @msg every numbered name for {name} is taken in that folder {name} için numaralandırılmış her ad o klasörde zaten kullanılıyor -@msg give id and path for one image, or ids and folder for several tek görsel için id ve path, birden çok görsel için ids ve folder verin @msg Reset {_1} {_1}'yi sıfırla @msg Sent to {_1} {_1}'ye gönderildi @msg {_1} files {_1} dosyaları diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 1c6f068b29..acc5978856 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -5356,7 +5356,6 @@ liquify-list-end {0}, {1} {0} і {1} @msg Unembedded to {_1} Вилучено у {_1} @msgplural Unembedded {n} image to {folder}|Unembedded {n} images to {folder} Вилучено {n} зображення у {folder}|Вилучено {n} зображення у {folder}|Вилучено {n} зображень у {folder} @msg every numbered name for {name} is taken in that folder усі нумеровані імена для {name} уже зайняті в цій папці -@msg give id and path for one image, or ids and folder for several укажіть id і path для одного зображення або ids і folder для кількох @msg Reset {_1} Скинуто: {_1} @msg Sent to {_1} Відправлено до {_1} @msg {_1} files {_1} файлів diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index afbe3c059b..58863733d1 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -5786,7 +5786,6 @@ liquify-list-end {0}, {1} {0} và {1} @msg Unembedded to {_1} Đã bỏ nhúng vào {_1} @msgplural Unembedded {n} image to {folder}|Unembedded {n} images to {folder} Đã bỏ nhúng {n} ảnh vào {folder} @msg every numbered name for {name} is taken in that folder mọi tên đánh số cho {name} đã được dùng trong thư mục đó -@msg give id and path for one image, or ids and folder for several hãy nhập id và path cho một ảnh, hoặc ids và folder cho nhiều ảnh @msg unknown command `{0}` lệnh không xác định `{0}` @msg step {step} of “{action}” runs the unknown command `{command}` bước {step} của “{action}” chạy lệnh không xác định `{command}` @msg unknown command `{0}`; did you mean `{1}`? lệnh không xác định `{0}`; ý bạn là `{1}`? diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index aef0eaec5f..8a445c42ef 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -5118,7 +5118,6 @@ liquify-list-end {0}, {1} {0}和{1} @msg Unembedded to {_1} 已取消嵌入到 {_1} @msgplural Unembedded {n} image to {folder}|Unembedded {n} images to {folder} 已将 {n} 张图像取消嵌入到 {folder} @msg every numbered name for {name} is taken in that folder 该文件夹中 {name} 的所有带编号的名称均已被占用 -@msg give id and path for one image, or ids and folder for several 单个图像请提供 id 和 path,多个图像请提供 ids 和 folder @msg no swatch library `{l}` (see swatch.library.list) 没有色板库 `{l}` (请参阅 swatch.library.list) @msg no user library folder here 此处没有用户库文件夹 @msg Couldn't place {name}: the document it was dropped on was closed 无法置入 {name}:将它拖放到的文档已关闭 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index b917cfe755..0db821596c 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -2751,7 +2751,6 @@ liquify-list-end {0}, {1} {0}和{1} @msg Unembedded to {_1} 已取消內嵌至 {_1} @msgplural Unembedded {n} image to {folder}|Unembedded {n} images to {folder} 已將 {n} 個影像取消內嵌至 {folder} @msg every numbered name for {name} is taken in that folder 該資料夾中 {name} 的所有編號名稱都已被使用 -@msg give id and path for one image, or ids and folder for several 單一影像請提供 id 和 path,多個影像請提供 ids 和 folder @msg no swatch library `{l}` (see swatch.library.list) 沒有色票資料庫 `{l}` (請參閱 swatch.library.list) @msg no user library folder here 此處沒有使用者資料庫資料夾 @msg Couldn't place {name}: the document it was dropped on was closed 無法置入 {name}:放置它的文件已關閉 diff --git a/docs/mcp.md b/docs/mcp.md index ce2a1b509d..72bac17fe1 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -8278,14 +8278,16 @@ every object in the layers each time the list is read. A `dcsTransparency` that returns `{id, onCanvas: false, owner}`, and the panel says the link has no place on the canvas. `links.embed {ids?}` keeps linked files' pixels in the document (an image whose file is missing stays linked: relink it first); `links.unembed {id, path}` writes an embedded image to a file (another extension converts it) and links to it, and without `path` returns `{name, dataBase64}`. -`links.unembed {ids?, folder}` writes each embedded image of `ids` (default: the selected embedded images) to a new +`ids` of one image works as `id` does. `links.unembed {ids?, folder}` writes each embedded image of `ids` (or of +`id`; default: the selected embedded images) to a new file in `folder`, in the format it is stored in (as PNG when that format is not one of VectorCraft's raster file formats), and links each image to its file, keeping its bounds, in one undo step; undo does not remove the files. A file is named after its image, with each character a file name can't hold (`/ \ : * ? " < > |` and control characters) as `_` and `Image` when nothing is left; when the name is taken it is `Name 2.png` … `Name 99.png`, and a file already in the folder is never replaced. Linked images among `ids` are left as they are and listed in `skipped`. It returns `{unembedded: [{id, path}], skipped}`. When an image can't be written, the files the call wrote are removed and the document does not change. A folder outside the automation write roots, -`id` or `path` given with `ids` or `folder`, an id given twice, and `ids` with no embedded image are errors. The Links +`id` given with `ids`, `path` given with `folder`, `ids` of more or fewer than one image without `folder`, an id given twice, and `ids` with +no embedded image are errors. The Links panel menu's Unembed… with several embedded images selected asks for one folder and runs this form (on the web it downloads each image instead and links none). `links.placementOptions {ids?, preserve?: transforms|bounds|fileDimensions|fit|fill, align?: topLeft…bottomRight,