Skip to content

VectorCraft: An open-source, vector art tool written by scratch in pure Rust

.ai palette: color groups are capped as swatches are

bflatastic9090afea1c99
diff --git a/crates/eps/src/import/ai/palette.rs b/crates/eps/src/import/ai/palette.rs
index 4769c4cf4..bf659cfe9 100644
--- a/crates/eps/src/import/ai/palette.rs
+++ b/crates/eps/src/import/ai/palette.rs
@@ -118,7 +118,10 @@ pub(super) fn palette(data: &[u8]) -> Palette {
});
}
"Pg" => {
- if let Some(name) = first_text(&vals) {
+ // Capped as swatches are: a file of many `Pg` would make as many empty groups.
+ if let Some(name) = first_text(&vals)
+ && out.groups.len() < MAX_SWATCHES
+ {
out.groups.push((name, Vec::new()));
}
}